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

Allow PROPFIND request with empty request body #122

Closed
wants to merge 1 commit into from

Conversation

greensea
Copy link

@greensea greensea commented Jan 7, 2023

A request body is not mandatory in PROPFIND request according to https://www.rfc-editor.org/rfc/rfc4918#section-9.1
If the client does not send a request body, the request should be treated as an AllProp request.

A request body is not mandatory in PROPFIND request according to https://www.rfc-editor.org/rfc/rfc4918#section-9.1 
If the client does not send a request body, the request should be treated as an AllProp request.
@emersion
Copy link
Owner

The server is not guaranteed to return a ContentLength header field though. It would be better to check for the io.EOF error instead.

@greensea
Copy link
Author

I am confused. The ContentLength is a request attribute, not a response header.

A client may send a request with an empty body, and the http.Request.ContentLength is 0. The patched code check this ContentLength property and make the request treated as an AllProp request.

@emersion
Copy link
Owner

Sorry, I got things mixed up: the client can omit the Content-Length header, but still provide a non-empty request body.

@emersion
Copy link
Owner

emersion commented Jan 8, 2024

Superseded by b043bbd

@emersion emersion closed this Jan 8, 2024
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

2 participants