Skip to content

AbstractSockJsService.checkAndAddCorsHeaders fails for same origin requests when setAllowedOrigins is set [SPR-12660] #17260

@spring-projects-issues

Description

@spring-projects-issues

Rob Winch opened SPR-12660 and commented

If the StompEndpointRegistry.setAllowedOrigins does not contain "*", then any requests made from the same domain will be rejected (i.e. it is only possible for an external domain to work).

This is due to the fact that that if a request made from the same domain, the browser does not add the "Origin" header. That means that checkAndAddCorsHeaders will reject the request.


Affects: 4.1.4

Reference URL: https://github.com/spring-projects/spring-framework/blob/v4.1.4.RELEASE/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/support/AbstractSockJsService.java#L427

Issue Links:

Referenced from: commits cc78d40, 9b3319b

0 votes, 5 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions