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
Hackney fails with nxdomain when the URL does not have path set and has query with / character. Likely because it is parsing URL incorrectly in this case.
$ rebar3 shell example:
>application:ensure_all_started(hackney).
ok>hackney:get("http://example.com?foo=/").
{error,nxdomain}
>% It works if we set path to / in the URL>hackney:get("http://example.com/?foo=/").
{ok,200,
[{<<"Age">>,<<"489847">>},
{<<"Cache-Control">>,<<"max-age=604800">>},
{<<"Content-Type">>,<<"text/html; charset=UTF-8">>},
{<<"Date">>,<<"Tue, 14 Feb 2023 08:01:55 GMT">>},
{<<"Etag">>,<<"\"3147526947+ident\"">>},
{<<"Expires">>,<<"Tue, 21 Feb 2023 08:01:55 GMT">>},
{<<"Last-Modified">>,<<"Thu, 17 Oct 2019 07:18:26 GMT">>},
{<<"Server">>,<<"ECS (dcb/7EEF)">>},
{<<"Vary">>,<<"Accept-Encoding">>},
{<<"X-Cache">>,<<"HIT">>},
{<<"Content-Length">>,<<"1256">>}],
#Ref<0.2060195221.1788346373.92043>}
Issue seems to be with hackney_url:parse module, it is parsing example.com?foo= as hostname leading to nxdomain error.
Hackney fails with
nxdomain
when the URL does not have path set and has query with/
character. Likely because it is parsing URL incorrectly in this case.$ rebar3 shell
example:Issue seems to be with
hackney_url:parse
module, it is parsingexample.com?foo=
as hostname leading tonxdomain
error.The text was updated successfully, but these errors were encountered: