RequestSerializer: include Content-Type and Content-Length headers. #79
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.
RequestSerializer returns, among other things, the filtered http headers
of the handled request, that is: all the HTTP_* headers normally
provided by Rack with a filtering rule applied (this is useful if you
want to e.g. mask or transform the content of some headers).
Among the request headers injected by Rack into the request environment
there are two notable exceptions to the 'HTTP_' rule: both CONTENT_TYPE
and CONTENT_LENGTH are not prefixed with 'HTTP_'. (more on this on the
Rack SPEC doc [0] and the lint file [1]).
This pull request changes the headers filtering logic to take both
CONTENT_TYPE and CONTENT_LENGTH into account. RequestSerializer will now
return 'http_content_type' and 'http_content_length'.
As far as I can tell this is a backward-compatible change as we're just
returning a new pair of headers. No filtering rule should be broken by
this change as such rules are only applied to the filtered headers.
[0] https://rubydoc.info/github/rack/rack/master/file/SPEC
[1] https://github.com/rack/rack/blob/master/lib/rack/lint.rb