Check the user of a SockJS request

Issue: SPR-12497
(backport of commit dc5b5c)
This commit is contained in:
Rossen Stoyanchev
2014-12-08 11:22:45 -05:00
parent 328ba7b6d4
commit ac5c361688
2 changed files with 32 additions and 0 deletions

View File

@@ -242,6 +242,15 @@ public class TransportHandlingSockJsService extends AbstractSockJsService implem
return;
}
}
else {
if (session.getPrincipal() != null) {
if (!session.getPrincipal().equals(request.getPrincipal())) {
logger.debug("The user for the session does not match the user for the request.");
response.setStatusCode(HttpStatus.NOT_FOUND);
return;
}
}
}
if (transportType.sendsNoCacheInstruction()) {
addNoCacheHeaders(response);