Nyholm / psr7

A super lightweight PSR-7 implementation
MIT License
1.16k stars 75 forks source link

Header validation error should include offending header value #193

Closed ostrolucky closed 2 years ago

ostrolucky commented 2 years ago

Any misbehaving client can send invalid header value and this package throws this error https://github.com/Nyholm/psr7/blob/28e9c474672d3474705227f6276b8f4d19297880/src/MessageTrait.php#L199

but offending header value is nowhere visible and it's kinda hard to find it. It would be better if this package did something similar like Guzzle does

https://github.com/guzzle/psr7/blob/c5b547b9904106507e48c645b76ff74f18eea84e/src/MessageTrait.php#L221

Nyholm commented 2 years ago

Yeah. I would be happy to improve this exception message.