Skip to content

Add same origin support to SockJS and WebSocket [SPR-12697] #17294

@spring-projects-issues

Description

@spring-projects-issues

Sébastien Deleuze opened SPR-12697 and commented

Simplified support for "same origin" requests for SockJS and WebSocket makes sense for a lot of use cases. But we can't just rely on the lack of Origin header to identify same origin requests, since for example Chrome provides it even for same origin AJAX requests.

As proposed by Rob Winch, we should support a smart "same origin" check that compares Origin header to Host header. A possible implementation is available in this Gist. This check should be added to both AbstractSockJSService and OriginHandshakeInterceptor.

You can see the impact on supported browsers when this mode is enabled in this browser support matrix.


Reference URL: https://gist.github.com/sdeleuze/a522ef9096b03737e553

Issue Links:

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions