Skip to content

DefaultCorsProcessor does not set "vary: Origin" if the request has no Cors header #22273

Closed
@mascheck

Description

@mascheck

The DefaultCorsProcessor will not set the "vary: Origin" header in the response, if the request is not a cors request.

Scenario:

  • The user visits the original page (without CORS).
  • Some scripts are cached without CORS and vary headers
  • The user visits page B which is using the same scripts. The browser wants to load them from the cache but get a CORS Error because of the missing CORS headers.

Discussions regarding this topic:
#18378 (especially the last comment)
https://stackoverflow.com/questions/25329405/why-isnt-vary-origin-response-set-on-a-cors-miss

I use Spring Boot 2.1.1.RELEASE

Are there any known workarounds?

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