warp icon indicating copy to clipboard operation
warp copied to clipboard

Add option to ignore content-length with multipart body

Open outamaa opened this issue 3 years ago • 2 comments

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.

outamaa avatar Nov 23 '21 06:11 outamaa

Hi, thanks for your interest! and sorry for the delay. I think this should rather be part of https://github.com/seanmonstar/warp/pull/846/ what do you think?

jxs avatar Dec 16 '21 20:12 jxs

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.

outamaa avatar Dec 17 '21 06:12 outamaa

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 :eyes:

xd009642 avatar May 24 '23 11:05 xd009642

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

outamaa avatar Jun 11 '23 11:06 outamaa

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

seanmonstar avatar Jun 12 '23 13:06 seanmonstar