W
W
wutiarn2014-02-26 18:16:42
linux
wutiarn, 2014-02-26 18:16:42

Tornado. Why wrong MIME when returning static?

Good afternoon. I have a small tornado project that only communicates with the client side using web sockets. Those. absolutely all project files downloaded by the user are static. For distribution I used tornado.web.StaticFileHandler.
And everything would be fine, but only in the project there are several fonts (ttf), which tornado stubbornly renders in the form of an html page (it even substitutes tags). Because of this, browsers refuse to download the font when loading the page. it is marked as text/html.
Using the option with an external server / cdn will not work, because. there is a possibility that the client will not have access to the Internet.
In general, the question itself is: how to make tornado return the correct MIME? Or, all the same, you should not even try and use the second http server (very undesirable, because all this canoe works on raspberry and resources are worth their weight in gold).
Thanks in advance for your replies.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
h31, 2014-07-27
@h31

There was a similar problem with SVG, while the Content-Type was not issued at all. Solution: somewhere at the beginning of the server run a similar command:
Accordingly, substitute your values ​​for ttf.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question