Skip to content
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

Bugfix: Multipart Content-Length #3189

Merged
merged 1 commit into from
Jul 1, 2020

Conversation

MGatner
Copy link
Member

@MGatner MGatner commented Jul 1, 2020

Description
Following RFC 7230, CURL requests currently set the Content-Length header to 0 for every POST and PUT request, to make sure it is present. This is overwritten by the actual length for application/x-www-form-urlencoded requests, but left in place for multipart/form-data which causes some servers to close the connection early (since 0 bytes are already done).

This PR makes the 0 setting conditional on the presence of multipart data, so the native CURL client can set the actual Content-Length automatically.

Checklist:

  • Securely signed commits
  • Component(s) with PHPdocs
  • Unit testing, with >80% coverage
  • n/a User guide updated
  • Conforms to style guide

@lonnieezell lonnieezell merged commit 65c9148 into codeigniter4:develop Jul 1, 2020
@MGatner MGatner deleted the content-length branch April 6, 2021 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants