-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Urgent - v2.1.1 - MessageTrait assertValue broken #489
Comments
I've got a second case that these changes are breaking.
|
I'm also getting it with the header |
To reproduce, tested on php 8.1 and guzzle 7.4
This will throw an error: |
Seems to also occur when upgrading Here are the changes: 1.8.3...1.8.4 Forcing composer to install 1.8.3 using The string that was used as header value on a Heroku dyno running PHP 8.0.17:
|
If you'd like to propose a fix, please do, since this is urgent for you. |
I have prepared a fix. Please can you try this out @thomas-alrek @mbabker @kissifrot @it-can @holtkamp.
|
cc @ibrasho |
@GrahamCampbell yes the fix is working for me... Thanks for the quick-fix! https://requestbin.com/r/en23lcyrh3o2p/26fRMDWJ8k32KhF1EAqZvPJU0vU |
1.8.5, 2.1.2, 2.2.1 released. |
Hi folks. Sorry for breaking this. When creating the validation regex I've faithfully transcribed the ABNF given in RFC 7230#3.2. Double checking the ABNF it looks like the validation in guzzle/psr7 was technically correct and the header values are indeed not valid with the current spec. But of course this is not useful to you. I've checked with the experts in #curl on libera.chat and it appears the error in the specification is already fixed in the latest draft: https://httpwg.org/http-core/draft-ietf-httpbis-semantics-latest.html#fields.values |
I am get
with
|
@samizdam can you submit a failing test please? |
This comment was marked as outdated.
This comment was marked as outdated.
Hidden above comment because it opens things up to major vulnerabilities. Locking down this whole thread, too. Everyone should only use the latest version. |
PHP version: 7.4.27 (hint:
php --version
)Description
I updated my dependencies, and guzzlehttp/psr7 was updated to v2.1.1. This broke an integration with a third party API that I'm working with. (Largest credit card payment processor in Scandiavia).
I have traced it down to the changes introduced in MessageTrait for the method
assertValue
.When the response (which I am not in control over), contains the following header, I get an InvalidArgumentException XXX is not a valid header value.
I have changed the actual values from the header, as I'm not sure if it contains confidential information. The relevant part here is the whitespaces, which failes the parsing introduced in 2.1.1.
How to reproduce
Add the above header to a response.
Possible Solution
Revert the changes done in 2.1.1 back to the behavior in 2.1.0
Additional context
The text was updated successfully, but these errors were encountered: