On 5/8/2015 12:48 PM, Peter Rifel wrote:
Chris,
Thanks for the advice but that doesn't seem to help. It looks like
ApplicationContext.getMimeType(String) extracts the extension from the file and uses that in
looking up the context's mime mapping. The .xml extension of the file results in the
"xml" mime-mapping's mime-type, and the "crossdomain.xml" mime-mapping is never
used.
Any other ideas?
What if you changed the filename so that "crossdomain.xml" was actually
an extension: filename.crossdomain.xml, or something similar?
Peter
On 5/8/15, 5:09 AM, "Christopher Schultz" <ch...@christopherschultz.net> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Peter Rifel,
On 5/7/15 5:06 PM, Peter Rifel wrote:
I'm using Tomcat 8.0.21 and have a static /crossdomain.xml file
that I would like to serve with a Content-Type of
"text/x-cross-domain-policy". I'm using the Tuckey url rewrite
filter to set the response's Content-Type but it appears to be
getting overwritten back to application/xml. Stepping through the
source code it looks like DefaultServlet.serveResource is grabbing
the mime-type from crossdomain.xml's webResource which I assume
comes from the global web.xml's mime-mappings. Is there a way to
override this, short of creating a new servlet that responds with
the file's contents?
Try adding this to your META-INF/web.xml:
<mime-mapping>
<extension>crossdomain.xml</extension>
<mime-type>text/x-cross-domain-policy</mime-type>
</mime-mapping>
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org
iQIcBAEBCAAGBQJVTKeSAAoJEBzwKT+lPKRYBb0P/AubjY5Pqafncs3zecKzw7W1
mdrTO6GeR5UYhimq6YymVOsc9P7y8f4WhAMmymc3WplMVYyE8LUmw3VtixoMTAJs
jral+X7/OHFtWh4P/FhXTizdU5dXEXJrnST/Kyhdol9bd9cJIzW0reWb9jvVphTI
STF8pg0AHN0paJYH7EYq83b3yZl3sLEPZdrtJdOazWbJeDLCS/bYDMZxkjswmTGp
mWVwcSSd8g1uSYvAEPF1f5fwEZlPJiPawQ33IrF41Dk0YNaCpzSulTxLiKTg6gxh
7vAtBbl2m9tVlCYLDCGgm4uFUUc189z0tB0RhHHuoULCSSDNMG89wuav8r+VOBND
9B3d4yTHKoopJqu17QY+Ttjx+aXYkN1Fb1Nr71E3/i2BrSgcOnvvOGNLsSEP2IK3
z6xShMnEynmCx3LK28oaTUkjqE8qpY+LLfTcFB7VH9C016b1FcOGxh87bFbuyIKt
88Etkoq8m6P5Gr2v5v47J7h/tE92BaYkPBS1Iy9hqW6WG5umaWkgHHhgYZd1eOqs
/Ww3iJ5JWXT4kdE/Z5nTSbQ+yxYlNuowPcd/GgoncS8ryruLSu8hpG3hlSilq4ZZ
htN56PRtDDJeioBdWd88eddwFdN6VU76d2lDhmzXqMmAyUsx4PKM/OegnZo63BxU
wDVxpsyhx6xHJt2DlZcs
=VdPD
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org