Skip to content

Conversation

@rtribotte
Copy link

This PR introduce a condition to set the Content-Type header, backed by a new test.

The goal is to have the identical behavior as the http/server and http/fs does.

Content-Type header will only be set with the detected MIME type if it is not already set, which means no header previously set (at all).
So the condition to set the header is when there is no existing key for the Content-Type header in the response writer map.

The purpose of handling the nil value could be seen as the capacity to disable content type detection, and at the same time, not having the Content-Type header in the resulting response for the client.

klauspost added a commit to klauspost/compress that referenced this pull request May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant