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

[3.0] Remove default content-length header from MultipartStream class #581

Open
wants to merge 3 commits into
base: 2.6
Choose a base branch
from

Conversation

Procionegobbo
Copy link

Content-Length in multipart bodies is not necessary. As far as I can verify is not used in any browser or other HTTP client.

For reference

@GrahamCampbell
Copy link
Member

Thanks for sending this in. I wanna wait till 3.0.0 to make this change. There are some other arguably breaking changes to make at the same time as this.

@GrahamCampbell
Copy link
Member

3.0.0 should be coming out this year, if I can find the time to work on it.

@GrahamCampbell GrahamCampbell changed the title Remove default content-length header from MultipartStream class [3.0] Remove default content-length header from MultipartStream class Sep 10, 2023
Copy link

stale bot commented Mar 13, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 2 weeks if no further activity occurs. Thank you for your contributions.

@marcogermani87
Copy link

marcogermani87 commented Apr 9, 2024

I think this pull request is very important.

Some legacies system can't manage the "Content-Length" header into "multipart/form-data" boundary and cut off the request.

For reference see the RFC 7578 in section 4.8 wich specify:

4.8. Other "Content-" Header Fields

The multipart/form-data media type does not support any MIME header
fields in parts other than Content-Type, Content-Disposition, and (in
limited circumstances) Content-Transfer-Encoding. Other header
fields MUST NOT be included and MUST be ignored.

Older system are not compliant because not apply the MUST be ignore policy but on the other side this code non apply the MUST NOT be included policy.

@stale stale bot removed the lifecycle/stale label Apr 9, 2024
@GrahamCampbell
Copy link
Member

I don't disagree. A 3.0 release is still planned.

@marcogermani87
Copy link

marcogermani87 commented Apr 12, 2024

I don't disagree. A 3.0 release is still planned.

Thanks, do you have an expected release date?

@GrahamCampbell
Copy link
Member

No, not yet. I hope some time in the summer.

@GrahamCampbell
Copy link
Member

I am likely to create a 3.0 branch in the next few days/weeks, and merge this, so you may be able to use an experimental 3.0-dev version for a bit if you want.

@marcogermani87
Copy link

marcogermani87 commented Apr 12, 2024

I am likely to create a 3.0 branch in the next few days/weeks, and merge this, so you may be able to use an experimental 3.0-dev version for a bit if you want.

Yes, of course; after merge i can use the experimental 3.0-dev. Actually i've already overrided in my project Client.php and MultipartStream.php files for exclude the "Content-Length" and works well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants