forked from I2P_Developers/i2p.i2p
Console: Fix mime type and encoding on javadoc pages
This commit is contained in:
@@ -4,12 +4,15 @@
|
||||
* Trailing whitespace OR NEWLINE on the last line will cause
|
||||
* IllegalStateExceptions !!!
|
||||
*
|
||||
* Note: this also handles /javadoc/ URLs
|
||||
*
|
||||
* Do not tag this file for translation.
|
||||
*/
|
||||
|
||||
String uri = request.getRequestURI();
|
||||
if (uri.endsWith(".css")) {
|
||||
response.setContentType("text/css");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
} else if (uri.endsWith(".png")) {
|
||||
response.setContentType("image/png");
|
||||
} else if (uri.endsWith(".gif")) {
|
||||
@@ -20,6 +23,14 @@ if (uri.endsWith(".css")) {
|
||||
response.setContentType("image/x-icon");
|
||||
} else if (uri.endsWith(".svg")) {
|
||||
response.setContentType("image/svg+xml");
|
||||
} else if (uri.endsWith(".html")) {
|
||||
// /javadoc/
|
||||
response.setContentType("text/html");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
} else if (uri.endsWith(".js")) {
|
||||
// /javadoc/
|
||||
response.setContentType("application/x-javascript");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
}
|
||||
response.setHeader("Accept-Ranges", "none");
|
||||
response.setHeader("X-Content-Type-Options", "nosniff");
|
||||
|
||||
Reference in New Issue
Block a user