Merge pull request #357 from patriot1burke/master

fix mime type
This commit is contained in:
Bill Burke 2014-04-30 14:26:12 -04:00
commit 95bafc416d
3 changed files with 6 additions and 2 deletions

View file

@ -102,6 +102,7 @@
<module>server</module>
<module>timer</module>
<module>bundled-war-example</module>
<!-- <module>project-integrations</module> -->
</modules>
<dependencyManagement>

View file

@ -10,6 +10,7 @@ import javax.activation.MimetypesFileTypeMap;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
@ -47,7 +48,8 @@ public class AdminResource {
Theme theme = ThemeLoader.createTheme(Config.getThemeAdmin(), Theme.Type.ADMIN);
InputStream resource = theme.getResourceAsStream(path);
if (resource != null) {
return Response.ok(resource).type(mimeTypes.getContentType(path)).build();
String contentType = mimeTypes.getContentType(path);
return Response.ok(resource).type(contentType).build();
} else {
return Response.status(Response.Status.NOT_FOUND).build();
}

3
services/src/main/resources/META-INF/mime.types Normal file → Executable file
View file

@ -1,4 +1,5 @@
text/css css CSS
text/javascript js JS
text/javascript js JS
image/svg+xml svg SVG
image/svg+xml svg SVG
text/html html htm HTML HTM