-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add support for HTTP encodings #7915
Conversation
packetbeat/protos/http/decode.go
Outdated
io.Reader | ||
} | ||
|
||
func (_ closeDecorator) Close() error { |
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.
receiver name should not be an underscore, omit the name if it is unused
3c0b500
to
755e9dd
Compare
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.
The code looks good + lot's of tests cases 👍 .
I think we need to add some new information to the packetbeat documenation explaining the behavior for these header types.
And add a CHANGELOG entry.
76bc67b
to
046355a
Compare
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
Needs a |
This patch adds support for decoding HTTP bodies based on the `Content-Encoding` and `Transfer-Encoding` headers. Supported decoders are `gzip` and `deflate`. Multiple encoders are supported, for example: ``` Content-Encoding: gzip Transfer-Encoding: chunked ``` Or the rarely used but allowed by the standard: ``` Transfer-Encoding: deflate, gzip ``` The difference between `Transfer-Encoding` and `Content-Encoding` is not relevant to packetbeat, so both are treated the same, with the exception that `chunked` can only appear as the last or only element of `Transfer-Encoding`. To avoid decompression bombs, the value specified in `http.max_message_size` (default 10MB) is honored when decoding. A new configuration option, `decode_body` (default true), has been added to the http protocol, allowing to disable this feature.
046355a
to
d1e686b
Compare
Hi @andrewkroh , I updated the PR and added a new configuration option and docs |
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
This patch adds support for decoding HTTP bodies based on the
Content-Encoding
andTransfer-Encoding
headers. Supported decoders aregzip
anddeflate
.Multiple encoders are supported, for example:
Or the rarely used but allowed by the standard:
The difference between
Transfer-Encoding
andContent-Encoding
is not relevant to packetbeat, so both are treated the same, with the exception thatchunked
can only appear as the last or only element ofTransfer-Encoding
.To avoid decompression bombs, the value specified in
http.max_message_size
(default 10MB) is honored when decoding.A new configuration option,
decode_body
(default true), has been added to the http protocol, allowing to disable this feature.