Mime-type for static assets

115 views
Skip to first unread message

Mark Waddle

unread,
Oct 31, 2012, 11:42:27 PM10/31/12
to play-fr...@googlegroups.com
I am serving WOFF (Web Open Font Format) files with Play. The mimetype for .woff files is not included in the defaults for Play so it responds with a content-type of "application/octet-stream".

I tried to specify a custom mimetype in the application.conf like the following, but it doesn't seem to have any effect:
mimetype.woff="application/font-woff"

I tried clean/compile, reload, etc. Anyone know what I'm doing wrong?

And as an aside, to find out this was possible I had to crack open the Play code. This should probably be documented as it is a common need when serving static resources.

Thanks for any help!
Mark

Mark Waddle

unread,
Oct 31, 2012, 11:44:36 PM10/31/12
to play-fr...@googlegroups.com
Sorry for not including the version in the subject line. This is for [2.0.4 scala]. Thanks!

Nilanjan

unread,
Nov 1, 2012, 12:07:57 AM11/1/12
to play-fr...@googlegroups.com
Play 2 does not read mimetype from application.conf. I think it works for Play 1. You can create a ticket for it.

Nilanjan
Reply all
Reply to author
Forward
0 new messages