We got an issue reported over at https://github.com/getsentry/sentry-php, that cURL 8.1.0 and up no longer work as expected when using the DecoderPlugin.
See getsentry/sentry-php#1537 and curl/curl#11175.
From @krowinski
The problem is in \Http\Client\Common\Plugin\DecoderPlugin::handleRequest as is adding header 'TE'
$request = $request->withHeader('TE', $encodings);
with values
"TE" => array:3 [ 0 => "gzip" 1 => "deflate" 2 => "chunked" ]
And RFC for HTTP/2 specifies The only exception to this is the TE header field, which MAY be present in an HTTP/2 request; when it is, it MUST NOT contain any value other than "trailers"."
https://httpwg.org/specs/rfc9113.html#rfc.section.8.2.2
Its connected to curl lib as on 8.1.0 we got error
curl -X POST https://google.com -d '' -H "TE: gzip"
curl: (56) HTTP/2 stream 1 was reset
and before is was ok
curl -X POST https://google.com -d '' -H "TE: gzip"
<!DOCTYPE html>
But still php http client should not add invalid headers as curl seems to be more strict(?)
We got an issue reported over at https://github.com/getsentry/sentry-php, that cURL 8.1.0 and up no longer work as expected when using the
DecoderPlugin.See getsentry/sentry-php#1537 and curl/curl#11175.
From @krowinski
The problem is in
\Http\Client\Common\Plugin\DecoderPlugin::handleRequestas is adding header 'TE'$request = $request->withHeader('TE', $encodings);with values
"TE" => array:3 [ 0 => "gzip" 1 => "deflate" 2 => "chunked" ]And RFC for HTTP/2 specifies
The only exception to this is the TE header field, which MAY be present in an HTTP/2 request; when it is, it MUST NOT contain any value other than "trailers"."https://httpwg.org/specs/rfc9113.html#rfc.section.8.2.2
Its connected to curl lib as on 8.1.0 we got error
and before is was ok
But still php http client should not add invalid headers as curl seems to be more strict(?)