You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been having trouble making IPv6 GET requests with the cohttp lib: when the host part of a Uri is an IPv6 litteral brackets needs to be added around it when creating the Host header of the request, please see below:
A request created by this lib:
it does not have the brackets and so the Full requst uri field is not valid, whereas a simple wget from the same machine:
does have them an the URI is valid.
I've been working around it by manually adding the host field with the brackets:
let headers =Cohttp.Header.init ()inlet headers =Cohttp.Header.add_unless_exists headers "host"
(matchUri.scheme uri with|Some"httpunix" -> ""|_ -> (
(Http.Url.maybe_wrap_IPv6_literal (Uri.host_with_default ~default:"localhost" uri))
^matchUri.port uri withSomep ->":"^ string_of_int p |None ->""))
inlet request =Cohttp.Request.make ~meth:`GET ?headers:(Some headers) uri in
But the default host when not manually provided should also have them.
From what i understand the brackets should be added here when the host of uri is in IPv6 litteral.
Thanks
The text was updated successfully, but these errors were encountered:
Hello!
I've been having trouble making IPv6 GET requests with the cohttp lib: when the host part of a
Uri
is an IPv6 litteral brackets needs to be added around it when creating theHost
header of the request, please see below:A request created by this lib:
it does not have the brackets and so the Full requst uri field is not valid, whereas a simple wget from the same machine:
does have them an the URI is valid.
I've been working around it by manually adding the host field with the brackets:
But the default host when not manually provided should also have them.
From what i understand the brackets should be added here when the
host
ofuri
is in IPv6 litteral.Thanks
The text was updated successfully, but these errors were encountered: