-
Notifications
You must be signed in to change notification settings - Fork 759
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
Stop sending Content-Length header for verbs which don't have bodies. #1388
Conversation
5a29284
to
b9f9fc1
Compare
`https://${options.host}`, | ||
// No Content-Length should be present for GET requests. | ||
{ | ||
badheaders: ['Content-Length'], |
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.
TIL 👍
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.
Beautiful!
r? @yejia-stripe for calibration 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.
Lgtm! Thanks for the detailed comments
r? @pakrym-stripe
Summary
Stops sending a
Content-Length
header for requests which:GET
,DELETE
) andFor requests that don't anticipate a body but end up having one, we'll continue setting the header and emit a warning so that we can track and fix these cases as they are not following proper semantics.
POST
,PUT
andPATCH
request are unchanged.Motivation
Fixes #1360