Skip to content

Commit

Permalink
Update to Cohttp.0.12.0 API
Browse files Browse the repository at this point in the history
This is the API in [mirage/ocaml-cohttp#196]

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
  • Loading branch information
David Scott committed Nov 4, 2014
1 parent b6d4256 commit 5e48398
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/impl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -689,14 +689,14 @@ let write_stream common s destination source_protocol destination_protocol preze
| Some x ->
begin match Re_str.bounded_split_delim (Re_str.regexp_string ":") x 2 with
| [ user; pass ] ->
let b = Cohttp.Auth.string_of_resp (`Basic (user, pass)) in
let b = Cohttp.Auth.string_of_credential (`Basic (user, pass)) in
Header.add headers "authorization" b
| _ ->
Printf.fprintf stderr "I don't know how to handle authentication for this URI.\n Try scheme://user:password@host/path\n";
exit 1
end in
let request = Cohttp.Request.make ~meth:`PUT ~version:`HTTP_1_1 ~headers uri' in
Request.write (fun t _ -> return ()) request c >>= fun () ->
Request.write (fun _ -> return ()) request c >>= fun () ->
Response.read (Cohttp_unbuffered_io.make_input c) >>= fun r ->
begin match r with
| `Invalid x -> fail (Failure (Printf.sprintf "Invalid HTTP response: %s"
Expand Down

0 comments on commit 5e48398

Please sign in to comment.