Looking for Erlang v21 https:get() options

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Looking for Erlang v21 https:get() options

bengt e

I have a test case, originally for Erlang v20, where I do
httpc:request(get, {"http://[::1]:8888/apath", []}, [], [{ipv6_host_with_brackets, true}]).
(it is to verify that Cowboy has started correctly by looking at the contents of the returned Body).

After upgrading to v21 this test case fails. DNS can not find [::0], there is no attempt to request/4 to localhost. I am on Ubuntu 18.10 if that can
be a cause of problems.
Remove the option {ipv6_host_with_brackets, true} and DNS is no longer involved and the request is done.
But then Cowboy complains: The host header is invalid. (RFC7230 5.4) and in the reply there is no Body.
The missing Body was what prompted me to add the option in the first place (v20).

Is there a new, v21, option that I have missed that would allow this(*) to work?

If not, and if the v20 behaviour is not possible anymore, perhaps a new option:
{ipv6_host_with_brackets_in_http_header, true} can be introduced?
It would only add the brackets to IPv6 addresses in HTTP headers, while allowing httpc to remove them for other (DNS) usage.

Best Wishes,
(*) Erlang v21, https:get/4, Cowboy,  [::0]

erlang-questions mailing list
[hidden email]