Skip to content
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

Content-Type: text/plain is added to header if Content-Type header is not present #7012

Closed
PeterFalken opened this issue Jul 8, 2020 · 3 comments

Comments

@PeterFalken
Copy link

This was reported previously as issue #4761
In this case FireFox can't render the webpage that was sent and only displays the HTML code instead of rendering the page.
This affects the newest release 2.2.2

./traefik version
Version: 2.2.2
Codename: chevrotin
Go version: go1.14.4
Built: 2020-07-08T15:30:29Z
OS/Arch: linux/amd64

Original headers:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5
Transfer-Encoding: chunked
Date: Wed, 08 Jul 2020 19:48:50 GMT

Header server after Traefik:

HTTP/1.1 200 OK
Date: Wed, 08 Jul 2020 19:50:33 GMT
Server: Apache-Coyote/1.1
X-Content-Type-Options: nosniff
X-Powered-By: Servlet 2.4; JBoss-4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)/Tomcat-5.5
Content-Type: text/plain; charset=utf-8
Transfer-Encoding: chunked

In order to reproduce - use any other proxy or nginx to strip the Content-Type header and feed the request to Traefik - inspecting the Response Headers after being sent by Traefik, you can see that the Content-Type header is now:
"Content-Type: text/plain;"

@ldez ldez closed this as completed Jul 8, 2020
@PeterFalken
Copy link
Author

Thank you for pointing me in the right direction, Ludovic.

@PeterFalken
Copy link
Author

@ldez , would it be possible to add a similar option for the Compress middleware?
So that the MIME auto-detection can be skipped for responses where Content-Type header is not defined.

@traefik traefik locked and limited conversation to collaborators Aug 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants