Page MenuHomePhabricator

Font list resource doesn't have a "Content-type: text/plain;charset=utf-8" header
Closed, ResolvedPublic

Description

Hi !

I just noticed the list of fonts supported by SVG to raster conversion tools (which @Dereckson linked to me) did not send an appropriate Content-type header.

With Firefox policy of always trying to not have invalid chars, thus defaulting to an ISO-8859-* font, this ends up showing "weird chars" in the font list (namely, ISO-8859 codepoints corresponding to the individual bytes of the - assumed - UTF-8 plain text data).

While it is not crucial, I hate to see a misencoding somewhere ;-)

Event Timeline

Apache configuration explicitely sets AddDefaultCharset:

modules/noc/templates/noc.wikimedia.org.erb
<Directory /srv/mediawiki/docroot/noc/conf>
    AddDefaultCharset utf-8
</Directory>

According Apache configuration, "This directive specifies a default value for the media type charset parameter to be added to a response if and only if the response's content-type is either text/plain or text/html."

But https://noc.wikimedia.org/conf/fc-list headers ­doesn't show a Content-Type, at least when served by Varnish.

elukey subscribed.

The conf file does not have an extension and I think that Apache does not have any instruction about the MIME type to use.

Interesting link: http://stackoverflow.com/questions/29398123/apache-2-4-set-mime-type-of-file-without-extension

Not sure what is the best solution though..

Change 318074 had a related patch set uploaded (by Elukey):
Force Content-type for files without extensions (noc.w.o)

https://gerrit.wikimedia.org/r/318074

Change 318074 merged by Elukey:
Force Content-type for files without extensions (noc.w.o)

https://gerrit.wikimedia.org/r/318074

elukey claimed this task.

Just deployed, now https://noc.wikimedia.org/conf/fc-list looks good :)