-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Refine when content is expected #2044
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
Conversation
@falbrechtskirchinger thanks for the pull request, but #609 appears again with this change. Could you take a look at it? |
Sure, I'll take a look.
Thanks! |
Consider Content-Length and Transfer-Encoding headers when determining whether to expect content. Don't handle the HTTP/2 connection preface pseudo-method PRI. Fixes yhirose#2028.
ecc1628
to
5733afa
Compare
@yhirose I've re-added |
@@ -5381,10 +5381,14 @@ write_multipart_ranges_data(Stream &strm, const Request &req, Response &res, | |||
|
|||
inline bool expect_content(const Request &req) { | |||
if (req.method == "POST" || req.method == "PUT" || req.method == "PATCH" || | |||
req.method == "PRI" || req.method == "DELETE") { | |||
req.method == "DELETE") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for the fix. Btw as explained in #2028 (comment) , we should also add OPTIONS
here (or maybe replace HEAD
with OPTIONS
here, I'm not sure if the browser even use HEAD or not)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. As long as Content-Length
is set, things should work. The explicit handling of DELETE
is specifically for handlers with content receivers. For OPTIONS
requests, we have no such handlers.
I cannot reproduce any issues with OPTIONS
. If that still fails, let me know what you're doing and I'll check on my end.
@falbrechtskirchinger thanks for the fine contribution! |
Consider
Content-Length
andTransfer-Encoding
headers when determining whether to expect content.Don't expect content fordon't handle the HTTP/2 connection preface pseudo-methodDELETE
requests andPRI
.Fixes #2028.