[erlang-questions] Looking for Erlang v21 https:get() options
bengt
cean.ebengt@REDACTED
Sat Dec 1 10:51:40 CET 2018
Greetings,
I have a test case, originally for Erlang v20, where I do
httpc:request(get, {"http://[::1]:8888/apath <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,
bengt
(*) Erlang v21, https:get/4, Cowboy, [::0]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20181201/6cf6df10/attachment.htm>
More information about the erlang-questions
mailing list