fix mimetype
This commit is contained in:
parent
8ed5282da5
commit
8c5ae9d052
3 changed files with 7 additions and 2 deletions
1
pom.xml
1
pom.xml
|
@ -102,6 +102,7 @@
|
||||||
<module>server</module>
|
<module>server</module>
|
||||||
<module>timer</module>
|
<module>timer</module>
|
||||||
<module>bundled-war-example</module>
|
<module>bundled-war-example</module>
|
||||||
|
<!-- <module>project-integrations</module> -->
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
|
|
|
@ -10,6 +10,7 @@ import javax.activation.MimetypesFileTypeMap;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
import javax.ws.rs.PathParam;
|
import javax.ws.rs.PathParam;
|
||||||
|
import javax.ws.rs.Produces;
|
||||||
import javax.ws.rs.core.Context;
|
import javax.ws.rs.core.Context;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import javax.ws.rs.core.UriInfo;
|
import javax.ws.rs.core.UriInfo;
|
||||||
|
@ -47,7 +48,9 @@ public class AdminResource {
|
||||||
Theme theme = ThemeLoader.createTheme(Config.getThemeAdmin(), Theme.Type.ADMIN);
|
Theme theme = ThemeLoader.createTheme(Config.getThemeAdmin(), Theme.Type.ADMIN);
|
||||||
InputStream resource = theme.getResourceAsStream(path);
|
InputStream resource = theme.getResourceAsStream(path);
|
||||||
if (resource != null) {
|
if (resource != null) {
|
||||||
return Response.ok(resource).type(mimeTypes.getContentType(path)).build();
|
String contentType = mimeTypes.getContentType(path);
|
||||||
|
logger.info("contentType: " + contentType);
|
||||||
|
return Response.ok(resource).type(contentType).build();
|
||||||
} else {
|
} else {
|
||||||
return Response.status(Response.Status.NOT_FOUND).build();
|
return Response.status(Response.Status.NOT_FOUND).build();
|
||||||
}
|
}
|
||||||
|
|
1
services/src/main/resources/META-INF/mime.types
Normal file → Executable file
1
services/src/main/resources/META-INF/mime.types
Normal file → Executable file
|
@ -2,3 +2,4 @@ text/css css CSS
|
||||||
text/javascript js JS
|
text/javascript js JS
|
||||||
text/javascript js JS
|
text/javascript js JS
|
||||||
image/svg+xml svg SVG
|
image/svg+xml svg SVG
|
||||||
|
text/html html htm HTML HTM
|
Loading…
Reference in a new issue