Open philippseith opened 1 year ago
I got Elixir 1.14.5 set up with lighttpd hosting a single file bound on that [::1]
IP address. It's also using Erlang/OTP 25.3.2.6.
iex> HTTPoison.get!("[::1]:8080/index.txt")
%HTTPoison.Response{
status_code: 200,
body: "Hello, Elixir!\n",
headers: [
{"Content-Type", "text/plain;charset=utf-8"},
{"ETag", "\"4116816263\""},
{"Last-Modified", "Fri, 06 Oct 2023 20:43:35 GMT"},
{"Content-Length", "15"},
{"Accept-Ranges", "bytes"},
{"Date", "Fri, 06 Oct 2023 20:55:21 GMT"},
{"Server", "lighttpd/1.4.71"}
],
request_url: "http://[::1]:8080/index.txt",
request: %HTTPoison.Request{
method: :get,
url: "http://[::1]:8080/index.txt",
headers: [],
body: "",
params: %{},
options: []
}
}
I'm not sure how to reproduce the bug, did it get fixed on your end?
I am trying to build a simple reverse proxy with https://hexdocs.pm/reverse_proxy_plug and its httpoison plugin. I am trying to forward requests to a (angular dev-). server, listening on localhost:4200. As localhost is ipv6 on macOS and hackney does not seem to resolve this correctly (see https://github.com/benoitc/hackney/issues/718), I set the upstream to "http://[::1]:4200/" which reaches :hackney.request/5 as "http://::1:4200" and causes
IMHO the square brackets must not be removed from the url.
used versions: OTP 25 Elixir 1.14.1 Httpoison 2.1.0 hackney 1.18.1