hyperium / hyper

An HTTP library for Rust
https://hyper.rs
MIT License
14.49k stars 1.6k forks source link

Add support for ignore_invalid_headers_in_responses in client::Builder #2879

Open eyalsatori opened 2 years ago

eyalsatori commented 2 years ago

Is your feature request related to a problem? Please describe.

I am trying to fetch resource that located behind Imperva/Incapsula WAF. As part it's client-classification process sometimes the WAF added cookies in the following format Set-Cookie: ___utmvaPRuXKscZ=dmo\x01OZPF; path=/; Max-Age=900; Secure; SameSite=None\r\n this cookie include the invalid \x01 in the middle. Currently I am not able to parse such responses with hyper-client,

Describe the solution you'd like httparse has support in ignore_invalid_headers_in_response flags , I want to add the support to this flag in the same way that hyper support allow_obsolete_multiline_headers_in_responses .

Describe alternatives you've considered N/A

Additional context If it's sounds good I will start to work on PR

eyalsatori commented 2 years ago

Just noticed that it's been added to httparse after the last release, so probably will need to wait for new httparse release

eyalsatori commented 2 years ago

just found the #2819 Draft :)