| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
guzzlehttp/psr7 2.11 deprecates passing a non-string to MessageInterface::withHeader(), and 3.0 will require string|string[]. mb_strlen() returns an int, so every request with a body emits: Passing int to MessageInterface::withHeader() is deprecated; guzzlehttp/psr7 3.0 requires string|string[]. Cast the value to string to silence the deprecation and stay forward-compatible with psr7 3.0.
|
I have signed the CLA! |
Sorry, something went wrong.
|
Need to merge this please. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
WHY are these changes introduced?
guzzlehttp/psr7 2.11 deprecates passing a non-string value to MessageInterface::withHeader(), and 3.0 will require string|string[]:
In Http::request(), the Content-Length header is set to the return value of mb_strlen($bodyString), which is an int. As a result, every request that includes a body (POST/PUT) emits this deprecation. On production this fills logs/APM with deprecation warnings, and it will become a hard incompatibility once guzzlehttp/psr7 3.0 is adopted.
WHAT is this pull request doing?
Casts the Content-Length header value to string so it satisfies the PSR-7 MessageInterface::withHeader() contract.
This is behavior-preserving: psr7 already coerces the value to a string internally, so the serialized header (Content-Length: <n>) is unchanged. The existing Http/Rest/Graphql client tests that assert Content-Length: <length> continue to pass.
Type of change
Checklist