benoitc / hackney

simple HTTP client in Erlang
Other
1.34k stars 427 forks source link

`content-disposition` with trailing `;` fails to parse #618

Open ndarilek opened 4 years ago

ndarilek commented 4 years ago

Not sure if this is a spec violation, but:

:hackney_headers.content_disposition("attachment; filename=\"ig-ag302.html\";")
{:error, :badarg}
:hackney_headers.content_disposition("attachment; filename=\"ig-ag302.html\"")
{"attachment", [{"filename", "ig-ag302.html"}]}

Encountered that when running against a local endpoint. For now we removed the ; from our own headers, but this worked in the browser, so I'm not sure if the issue was ours or with Hackney.

Thanks!