You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "info@flyingfischer.ch" <in...@flyingfischer.ch> on 2018/12/26 21:49:00 UTC

Wrong content-type for CSS files since 8.5.37 / 9.0.14

Tomcat versions 8.5.37 and 9.0.14 seem to serve CSS files embedded in a
webapp as

content-type: text/html;charset=UTF-8

instead of

content-type: text/css;charset=UTF-8

This causes the browser (FF) not to interpret the CSS.

I suspect the listed change in changelog of 8.5.36: "The default Servlet
should not override a previously set content-type. (remm)"

Markus

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Wrong content-type for CSS files since 8.5.37 / 9.0.14

Posted by "info@flyingfischer.ch" <in...@flyingfischer.ch>.
Am 27.12.18 um 21:34 schrieb Rémy Maucherat:
> On Thu, Dec 27, 2018 at 9:30 PM Mark Thomas <ma...@apache.org> wrote:
>
>> On December 26, 2018 9:49:00 PM UTC, "info@flyingfischer.ch" <
>> info@flyingfischer.ch> wrote:
>>> Tomcat versions 8.5.37 and 9.0.14 seem to serve CSS files embedded in a
>>> webapp as
>>>
>>> content-type: text/html;charset=UTF-8
>>>
>>> instead of
>>>
>>> content-type: text/css;charset=UTF-8
>>>
>>> This causes the browser (FF) not to interpret the CSS.
>>>
>>> I suspect the listed change in changelog of 8.5.36: "The default
>>> Servlet
>>> should not override a previously set content-type. (remm)"
>> Sounds likely.
>>
>> Whatever part of the app is setting the incorrect content type (probably a
>> filter) needs to be fixed.
>>
> Yes, I also prefer keeping the new behavior, which was suggested by
> Christopher. Worst case scenario there should be a new init-param.
>
> Rémy
>
I could get it fixed by disabling a filter in the (legacy) app, which
did set a hardcoded content-type to UTF-8.

Markus


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Wrong content-type for CSS files since 8.5.37 / 9.0.14

Posted by Rémy Maucherat <re...@apache.org>.
On Thu, Dec 27, 2018 at 9:30 PM Mark Thomas <ma...@apache.org> wrote:

> On December 26, 2018 9:49:00 PM UTC, "info@flyingfischer.ch" <
> info@flyingfischer.ch> wrote:
> >Tomcat versions 8.5.37 and 9.0.14 seem to serve CSS files embedded in a
> >webapp as
> >
> >content-type: text/html;charset=UTF-8
> >
> >instead of
> >
> >content-type: text/css;charset=UTF-8
> >
> >This causes the browser (FF) not to interpret the CSS.
> >
> >I suspect the listed change in changelog of 8.5.36: "The default
> >Servlet
> >should not override a previously set content-type. (remm)"
>
> Sounds likely.
>
> Whatever part of the app is setting the incorrect content type (probably a
> filter) needs to be fixed.
>

Yes, I also prefer keeping the new behavior, which was suggested by
Christopher. Worst case scenario there should be a new init-param.

Rémy

Re: Wrong content-type for CSS files since 8.5.37 / 9.0.14

Posted by Mark Thomas <ma...@apache.org>.
On December 26, 2018 9:49:00 PM UTC, "info@flyingfischer.ch" <in...@flyingfischer.ch> wrote:
>Tomcat versions 8.5.37 and 9.0.14 seem to serve CSS files embedded in a
>webapp as
>
>content-type: text/html;charset=UTF-8
>
>instead of
>
>content-type: text/css;charset=UTF-8
>
>This causes the browser (FF) not to interpret the CSS.
>
>I suspect the listed change in changelog of 8.5.36: "The default
>Servlet
>should not override a previously set content-type. (remm)"

Sounds likely.

Whatever part of the app is setting the incorrect content type (probably a filter) needs to be fixed.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org