Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[HttpClient] Calculate request content-length #45260

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

Closed
ro0NL opened this issue Jan 31, 2022 · 0 comments
Closed

[HttpClient] Calculate request content-length #45260

ro0NL opened this issue Jan 31, 2022 · 0 comments

Comments

@ro0NL
Copy link
Contributor

ro0NL commented Jan 31, 2022

Description

See phpro/soap-client#416 for background.

It would be nice if HttpClient calculates a default request content-length header.

I think generally the more http details we provide, the better.

Another option/behavior could be to force re-calculate an existing content-length header as httplug does: https://github.com/php-http/curl-client/blob/2ed4245a817d859dd0c1d51c7078cdb343cf5233/src/Client.php#L346

But perhaps we should produce a log once we change the user value.

Example

No response

fancyweb added a commit that referenced this issue Feb 1, 2022
…las-grekas)

This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] Fix Content-Length header when possible

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #45260
| License       | MIT
| Doc PR        | -

When userland fails to compute the correct Content-Length header and we can fix it, as is the case in the linked issue.

Commits
-------

f5c2e6e [HttpClient] Fix Content-Length header when possible
@fancyweb fancyweb closed this as completed Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants