mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-02-15 11:51:59 +01:00
Added support for the new web files
This commit is contained in:
parent
86e48f6377
commit
783083fbb3
@ -134,9 +134,13 @@ public class ResponseHandler extends TreePageHandler {
|
|||||||
if (target.endsWith(".js")) {
|
if (target.endsWith(".js")) {
|
||||||
return ResponseCache.loadResponse(PageId.JS.of(resource), () -> responseFactory.javaScriptResponse(resource));
|
return ResponseCache.loadResponse(PageId.JS.of(resource), () -> responseFactory.javaScriptResponse(resource));
|
||||||
}
|
}
|
||||||
|
if (target.endsWith(".png")) {
|
||||||
|
return responseFactory.imageResponse(resource);
|
||||||
|
}
|
||||||
if (target.endsWith("favicon.ico")) {
|
if (target.endsWith("favicon.ico")) {
|
||||||
return ResponseCache.loadResponse(PageId.FAVICON.id(), responseFactory::faviconResponse);
|
return ResponseCache.loadResponse(PageId.FAVICON.id(), responseFactory::faviconResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isNotInfoRequest = target.isEmpty() || !target.get(0).equals("info");
|
boolean isNotInfoRequest = target.isEmpty() || !target.get(0).equals("info");
|
||||||
boolean isAuthRequired = webServer.get().isAuthRequired() && isNotInfoRequest;
|
boolean isAuthRequired = webServer.get().isAuthRequired() && isNotInfoRequest;
|
||||||
if (isAuthRequired && !authentication.isPresent()) {
|
if (isAuthRequired && !authentication.isPresent()) {
|
||||||
|
@ -40,7 +40,7 @@ public class FileResponse extends Response {
|
|||||||
int i;
|
int i;
|
||||||
for (i = 0; i < split.length; i++) {
|
for (i = 0; i < split.length; i++) {
|
||||||
String s = split[i];
|
String s = split[i];
|
||||||
if (Verify.equalsOne(s, "css", "js", "plugins", "scss")) {
|
if (Verify.equalsOne(s, "css", "js", "vendor", "img")) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,6 +128,10 @@ public class ResponseFactory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Response imageResponse(String fileName) {
|
||||||
|
return new ByteResponse(ResponseType.IMAGE, FileResponse.format(fileName), files);
|
||||||
|
}
|
||||||
|
|
||||||
public Response redirectResponse(String location) {
|
public Response redirectResponse(String location) {
|
||||||
return new RedirectResponse(location);
|
return new RedirectResponse(location);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user