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 is added to header if content-type is not present #4761

Closed
Gr33nbl00d opened this issue Apr 12, 2019 · 10 comments
Closed
Assignees
Labels
contributor/waiting-for-feedback kind/bug/possible a possible bug that needs analysis before it is confirmed or fixed. priority/P1 need to be fixed in next release status/5-frozen-due-to-age
Milestone

Comments

@Gr33nbl00d
Copy link

Gr33nbl00d commented Apr 12, 2019

What did you do?

configured 1 frontend and 1 backend with 1 server without any additional config

[entryPoints]
  [entryPoints.http]
  address = ":8880"
[backends]
  [backends.backend1]
    [backends.backend1.servers]
      [backends.backend1.servers.server0]
        url = "http://10.221.132.17:80"
		
[frontends]
  [frontends.frontend1]
    entryPoints = ["http", "https"]
    backend = "backend1"
    passHostHeader = true

requested a stylesheet stlye.css

What did you expect to see?

Unmodified (non existing) content-type

What did you see instead?

Traefik added a content-type: text to the header

Output of traefik version: (What version of Traefik are you using?)

1.7.10

Traefik generated header:

Accept-Ranges: bytes
Content-Length: 6717
Content-Type: text/plain; charset=utf-8
Date: Fri, 12 Apr 2019 11:53:43 GMT
Etag: W/"6717-1551984310000"
Last-Modified: Thu, 07 Mar 2019 18:45:10 GMT
Server: Apache-Coyote/1.1

Original server header:

Accept-Ranges: bytes
Content-Length: 6717
Date: Fri, 12 Apr 2019 11:50:43 GMT
ETag: W/"6717-1551984310000"
Last-Modified: Thu, 07 Mar 2019 18:45:10 GMT
Server: Apache-Coyote/1.1

It was already reported in bug
#3131

But you simply closed it with a Bot! Do you think problems go away by closing them????
I dont think i will use traefik as i seen such big issues are simply ignored...
Bad behaviour...

@geraldcroes geraldcroes added kind/bug/possible a possible bug that needs analysis before it is confirmed or fixed. and removed status/0-needs-triage labels Apr 12, 2019
@geraldcroes geraldcroes added the priority/P1 need to be fixed in next release label Apr 12, 2019
@geraldcroes
Copy link
Contributor

Hi @Gr33nbl00d , and thank you for reporting this issue.

As you noticed, this issue you're reporting has already been reported in the past, and unfortunately, despite our best effort, we weren't able to reproduce it (as @Ullaakut said there)

Please excuse our bot, it's doing its best to close issues tagged with "waiting-for-feedback" that are 90 days old without activity (as documented there). But it's not a bad bot per se, it really wants to keep things open, reason why it says you should feel free to re-open the/an issue 👍

So, in the end, we're happy to finally find someone able to provide us with a reproducible use case 🎉 Would you be so kind to send us one? (don't let the bot do its deed 😨) We'll sure fix it ASAP if it's confirmed.

Thank You!

@Gr33nbl00d
Copy link
Author

Ok i will put an example together on monday so you are able to reproduce it

@n2ygk
Copy link

n2ygk commented Apr 26, 2019

With apologies, my reproduction of the error was garbage. I've deleted the comments. My config had the wrong hostname (which I coped from my localhost testing). I was getting text/plain because it was a 404 response.

@Gr33nbl00d
Copy link
Author

Gr33nbl00d commented Apr 28, 2019 via email

@thtas
Copy link

thtas commented Apr 28, 2019

I've had this happen using Traefik combined with Geoserver running on Tomcat 8

https://www.github.com/kartoza/docker-geoserver

My fix was to add a mime mapping for css files in to the web.xml file for the app so that css files served up by Tomcat receive a css header.

<web-app>
   ...
   <mime-mapping>
        <extension>css</extension>
        <mime-type>text/css</mime-type>
    </mime-mapping>
</web-app>

Connecting directly to tomcat, the browser (firefox) will interpret CSS files correctly when there is no response header as it just assumes they are css, but when Traefik adds text/plain firefox won't render the css.

@Ullaakut
Copy link
Contributor

Ullaakut commented May 2, 2019

Just an update on this from @juliens: the issue seems to be due to the net/http package.

@traefiker
Copy link
Contributor

Hi! I'm Træfiker 🤖 the bot in charge of tidying up the issues.

I have to close this one because of its lack of activity 😞

Feel free to re-open it or join our Slack workspace for more community #support.

@billimek

This comment has been minimized.

@dduportal

This comment has been minimized.

@traefik traefik locked and limited conversation to collaborators Sep 13, 2019
@traefiker traefiker added this to the 2.1 milestone Jan 21, 2020
@traefiker
Copy link
Contributor

Closed by #6097.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
contributor/waiting-for-feedback kind/bug/possible a possible bug that needs analysis before it is confirmed or fixed. priority/P1 need to be fixed in next release status/5-frozen-due-to-age
Projects
None yet
Development

No branches or pull requests

8 participants