Wrap with the CheckTermsHandler is necessary.

This commit is contained in:
Anatoly Sablin
2019-11-25 23:35:56 +03:00
parent f9daf4d58a
commit a97273fe77
2 changed files with 9 additions and 1 deletions

View File

@@ -54,6 +54,11 @@ public class CheckTermsHandler extends BasicHttpHandler {
@Override
public void handleRequest(HttpServerExchange exchange) throws Exception {
if (policies == null || policies.isEmpty()) {
child.handleRequest(exchange);
return;
}
String token = findAccessToken(exchange).orElse(null);
if (token == null) {
log.error("Unauthorized request from: {}", exchange.getHostAndPort());