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

Reconsider if zero-length body is invalid #580

Closed
dashpole opened this issue Jan 28, 2025 · 2 comments
Closed

Reconsider if zero-length body is invalid #580

dashpole opened this issue Jan 28, 2025 · 2 comments

Comments

@dashpole
Copy link

I'm opening this issue to track #543 (comment), so it doesn't fall through the cracks. It is blocking kubernetes/kubernetes#128919 (comment).

From @liggitt:

Is an explicitly zero-length body always invalid? If not, the merged PR for this looks incorrect at first glance...

Things like https://lists.w3.org/Archives/Public/ietf-http-wg/2010JulSep/0276.html led me to think a zero-length body on put/post/patch was valid

How else would you send a text/plain POST or PUT intended to set an empty value?

(we spotted this while reviewing an update of the library for Kubernetes in kubernetes/kubernetes#128919)

Thanks!

@emicklei
Copy link
Owner

@dashpole thank you for this reminder. I will dive back into this.

@emicklei
Copy link
Owner

emicklei commented Feb 4, 2025

@dashpole can you have a look at this #581

emicklei added a commit that referenced this issue Feb 16, 2025
emicklei added a commit that referenced this issue Feb 26, 2025
* allow empty payloads in post,put,patch, issue #580

* remove content-length check in route detection

* detect mismatched content-type #580

* more tests

* remove 415 check in accept check

* update hist
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

No branches or pull requests

2 participants