Skip to content

When overriding httpConfig.CompressionAlgorithms, it rejects empty Content-Encoding #14131

@mterhar

Description

@mterhar

Component(s)

No response

What happened?

Describe the bug

In the Libhoney receiver, we added a lot of panic catching because the data coming in can be sometimes weird. The weird data was causing panics in the middleware code.

Steps to reproduce

Using the configuration CompressionAlgorithms: []string{}, I was able to take over decompression in the receiver and that made all the data coming in as gzip and zstd work fine.

What I didn't realize, was that this returned 400 errors for any requests that had a missing Content-Encoding or explicitly set to "".

What did you expect to see?

Empty string should pass the body through without decoding the same way it does for any of the set values.

What did you see instead?

Empty string rejects requests with a 400 bad request response and logs "unsupported Content-Encoding: "

Collector version

0.139.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

Log output

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions