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

Add option to ignore content-length with multipart body #919

Merged
merged 5 commits into from Jun 12, 2023

Conversation

outamaa
Copy link
Contributor

@outamaa outamaa commented Nov 23, 2021

The current implementation of multipart::form requires that the Content-Length header exists. However, there are valid situations where this is not the case, for example when Transfer-Encoding header is present. See e.g. RFC2616, section 4.4.

This PR adds an option to not check the content length, thus allowing the multipart::form filter to be used in cases where Content-Length header is not present. The change does not break the existing API.

@jxs
Copy link
Collaborator

jxs commented Dec 16, 2021

Hi, thanks for your interest! and sorry for the delay. I think this should rather be part of #846 what do you think?

@outamaa
Copy link
Contributor Author

outamaa commented Dec 17, 2021

Hi, thanks for your interest! and sorry for the delay.

No problem. Hope this proves useful to somebody else besides me. :)

I think this should rather be part of #846 what do you think?

I really have no strong preference one way or the other, though I do think of this as a separate feature to multipart being streamable. How would you suggest going forward with this?
Edit: To be clear, I'm fine with this being combined into #846. Please let me know if this needs some action on my part.

@xd009642
Copy link

Small bump as I was wondering what's taken to progress this as #846 is closed and multipart stuff in warp seems to have been redone recently but this feature still isn't present 👀

# Conflicts:
#	src/filters/multipart.rs
@outamaa
Copy link
Contributor Author

outamaa commented Jun 11, 2023

I now merged the changes from upstream master into this branch.

@seanmonstar
Copy link
Owner

Looks good to me. But CI is complaining about code style.

@seanmonstar seanmonstar merged commit e562afa into seanmonstar:master Jun 12, 2023
8 checks passed
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.

None yet

4 participants