Open mattmatters opened 4 years ago
There is a limit of 4096 bytes set to the header line to prevent DoS that may explain the error. It’s not configurable yet. I will add this option. For my curiosity’ is there any reason to use such ling urls?
Thanks @benoitc! I'm downloading data from an external service. The service used to do a redirect and set authentication stuff as cookies while redirecting. Now it instead does a redirect to a url with the authentication information directly in the url.
So the reasoning is that an external service has set up their authentication system really weirdly. Unfortunately it's been a really blocker for us recently.
Thanks for the prompt reply and looking into it :)
Looking at this error a bit more, it doesn't appear to be directly related to hparser.max_line_length
.
The case
here https://github.com/benoitc/hackney/blob/eefe744282c80524bb670a11e6bf5f1493936d41/src/hackney_stream.erl#L176 is not handling the {more, Client, <<>>}
case returned when hackney_http:parse_header
requires more data from the socket here: https://github.com/benoitc/hackney/blob/eefe744282c80524bb670a11e6bf5f1493936d41/src/hackney_http.erl#L284
Hiya, looks like the header parsing does not finish parsing the
Location
header when the url is incredibly long. This is in version 1.15.2.This might also occur when there are other headers, but the easiest way to reproduce was to make an async request with options
[stream_to: pid, async: :once, follow_redirect: true]
and have the server return a 302 redirect with a long url.Error (in elixir)
Cheers!