mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-27 03:27:37 +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);
|
||||
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 {
|
||||
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()) {
|
||||
authentication = request.getAuth();
|
||||
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);
|
||||
if (pageHandler == null) {
|
||||
return DefaultResponses.NOT_FOUND.get();
|
||||
|
@ -49,7 +49,7 @@ public class PromptAuthorizationResponse extends ErrorResponse {
|
||||
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();
|
||||
return response;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user