diff --git a/src/http_lwt_client.ml b/src/http_lwt_client.ml index 11205f8..7e907a5 100644 --- a/src/http_lwt_client.ml +++ b/src/http_lwt_client.ml @@ -281,7 +281,7 @@ let one_request single_request he ?config ?authenticator ~meth ~headers ?body uri >>= fun (resp, body) -> match resp.status with - | `Moved_permanently | `Found | `See_other | `Temporary_redirect -> + | #Status.redirection -> (match Headers.get resp.headers "location" with | Some location -> let uri = resolve_location ~uri ~location in diff --git a/src/http_lwt_client.mli b/src/http_lwt_client.mli index 2ade586..a04a3ab 100644 --- a/src/http_lwt_client.mli +++ b/src/http_lwt_client.mli @@ -12,8 +12,6 @@ type response = val pp_response : Format.formatter -> response -> unit -val resolve_location : uri:string -> location:string -> string - val one_request : ?config : [ `HTTP_1_1 of Httpaf.Config.t | `H2 of H2.Config.t ] -> ?authenticator:X509.Authenticator.t