Fix route login but no token
This commit is contained in:
parent
209aa5b6ce
commit
c4de049e58
1 changed files with 4 additions and 1 deletions
|
@ -62,7 +62,10 @@ public class Router{
|
|||
for(Entry<Response, Route> routes : this.responses.get(type).entrySet()){
|
||||
Matcher matcher = this.patterns.get(routes.getKey()).matcher(path);
|
||||
if(matcher.matches()){
|
||||
if(user == null && routes.getValue().needLogin()) return;
|
||||
if(user == null && routes.getValue().needLogin()){
|
||||
HttpUtil.responseHeaders(writer, 401, "Access-Control-Allow-Origin: *");
|
||||
return;
|
||||
}
|
||||
if(routes.getValue().websocket()){
|
||||
HttpUtil.switchToWebSocket(reader, writer);
|
||||
reader = new WebSocketReader(reader);
|
||||
|
|
Loading…
Add table
Reference in a new issue