mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-27 19:47:49 +01:00
Fixed 401 response to all css and js queries. Added reason to "cancel"
This commit is contained in:
parent
ef6ffdb980
commit
66e3f61203
@ -407,4 +407,13 @@ public class SQLFetchOps extends SQLOps implements FetchOperations {
|
|||||||
Collections.sort(servers);
|
Collections.sort(servers);
|
||||||
return servers;
|
return servers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UUID> getServerUUIDs() throws DBException {
|
||||||
|
try {
|
||||||
|
return serverTable.getServerUUIDs();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
throw SQLErrorUtil.getExceptionFor(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,13 @@ public class ResponseHandler extends TreePageHandler {
|
|||||||
|
|
||||||
private Response getResponse(Request request, String targetString, List<String> target) throws WebException {
|
private Response getResponse(Request request, String targetString, List<String> target) throws WebException {
|
||||||
Optional<Authentication> authentication = Optional.empty();
|
Optional<Authentication> authentication = Optional.empty();
|
||||||
|
|
||||||
|
if (targetString.endsWith(".css")) {
|
||||||
|
return ResponseCache.loadResponse(PageId.CSS.of(targetString), () -> new CSSResponse(targetString));
|
||||||
|
}
|
||||||
|
if (targetString.endsWith(".js")) {
|
||||||
|
return ResponseCache.loadResponse(PageId.JS.of(targetString), () -> new JavaScriptResponse(targetString));
|
||||||
|
}
|
||||||
if (webServer.isAuthRequired()) {
|
if (webServer.isAuthRequired()) {
|
||||||
authentication = request.getAuth();
|
authentication = request.getAuth();
|
||||||
if (!authentication.isPresent()) {
|
if (!authentication.isPresent()) {
|
||||||
@ -97,12 +104,6 @@ public class ResponseHandler extends TreePageHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (targetString.endsWith(".css")) {
|
|
||||||
return ResponseCache.loadResponse(PageId.CSS.of(targetString), () -> new CSSResponse(targetString));
|
|
||||||
}
|
|
||||||
if (targetString.endsWith(".js")) {
|
|
||||||
return ResponseCache.loadResponse(PageId.JS.of(targetString), () -> new JavaScriptResponse(targetString));
|
|
||||||
}
|
|
||||||
PageHandler pageHandler = getPageHandler(target);
|
PageHandler pageHandler = getPageHandler(target);
|
||||||
if (pageHandler == null) {
|
if (pageHandler == null) {
|
||||||
return DefaultResponses.NOT_FOUND.get();
|
return DefaultResponses.NOT_FOUND.get();
|
||||||
|
@ -49,7 +49,7 @@ public class PromptAuthorizationResponse extends ErrorResponse {
|
|||||||
reason += errorBuilder.toString();
|
reason += errorBuilder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
response.setParagraph("Authentication Failed.<br>Reason: " + reason + TIPS);
|
response.setParagraph("Authentication Failed.</p><p><b>Reason: " + reason + "</b></p><p>" + TIPS);
|
||||||
response.replacePlaceholders();
|
response.replacePlaceholders();
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user