diff --git a/docs/content/middlewares/compress.md b/docs/content/middlewares/compress.md index 35282da6c..cf62f119b 100644 --- a/docs/content/middlewares/compress.md +++ b/docs/content/middlewares/compress.md @@ -64,6 +64,9 @@ http: * The `Accept-Encoding` request header contains `gzip`. * The response is not already compressed, i.e. the `Content-Encoding` response header is not already set. + If Content-Type header is not defined, or empty, the compress middleware will automatically [detect](https://mimesniff.spec.whatwg.org/) a content type. + It will also set accordingly the `Content-Type` header with the detected MIME type. + ## Configuration Options ### `excludedContentTypes` diff --git a/docs/content/middlewares/contenttype.md b/docs/content/middlewares/contenttype.md index b92c272be..85ed8782f 100644 --- a/docs/content/middlewares/contenttype.md +++ b/docs/content/middlewares/contenttype.md @@ -21,6 +21,9 @@ This middleware exists to enable the correct behavior until at least the default is still to automatically set the `Content-Type` header. Therefore, given the default value of the `autoDetect` option (false), simply enabling this middleware for a router switches the router's behavior. + + The scope of the Content-Type middleware is the MIME type detection done by the core of Traefik (the server part). + Therefore, it has no effect against any other `Content-Type` header modifications (e.g.: in another middleware such as compress). ## Configuration Examples