-
Notifications
You must be signed in to change notification settings - Fork 656
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
CONNECT method should not have request body #637
CONNECT method should not have request body #637
Conversation
### Motivation: [rfc7231](https://tools.ietf.org/html/rfc7231#section-4.3.6) said: > A payload within a `CONNECT` request message has no defined semantics; sending a payload body on a `CONNECT` request might cause some existing implementations to reject the request. ### Modifications: Change `HTTPMethod.CONNECT.hasRequestBody` to returns `.no`. ### Result: `HTTPRequestEncoder` does not generate chunked body for `CONNECT` method.
Can one of the admins verify this patch? |
2 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Thanks for this patch! Sadly I wonder if perhaps we may need to fix this implementation a bit more. When RFC 7231 says “a payload has no defined semantics”, that is not the same as saying it may not be there. GET, for example, uses the same wording. So I think this enum is wrong for a number of methods, and many of them should go into |
It would also be really good to add a regression test for the CONNECT change to validate that it continues to work in future. |
Changed to
Is |
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.
Cool, this looks good to me! Sorry for the note about testing, that’s what happens when I review on my phone.
@swift-nio-bot test this please |
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.
thank you!
@swift-nio-bot test this please |
Thanks! 🙏 |
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.
late LGTM
CONNECT
method should not have request body.Motivation:
rfc7231 said:
Modifications:
Change
HTTPMethod.CONNECT.hasRequestBody
to returns.no
.Result:
HTTPRequestEncoder
does not generate chunked body forCONNECT
method.