Set Content-Length
header for OPTIONS requests
#742
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note also that this change was previously suggested as part of the resolution of #338, but it never made it to
master
.I'm not so happy about special-casing individual HTTP verbs like this, and I doubt the maintainers are, either. A better solution would involve disabling the default Node.js behavior described in the commit message (below). That behavior might make sense to make the
http
andhttps
modules more usable, but in the setting of an HTTP proxy, fidelity is much more important.This seems possible via the
useChunkedEncodingByDefault
attribute, but that is undocumented and likely unstable. I wasn't able to get it working locally, likely because this library usespipe
for all "incoming" requests. When piping data, theuseChunkedEncodingByDefault
flag does not seem to be honored. This probably makes sense because a streaming interface would generally emit data in chunks... so maybe special-casing HTTP verbs is the best approach, after all.Commit message: