Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293561

CORS breaks with cache proxies and same origin usage.

$
0
0

Problem/Motivation

If you use ajax requests from the same origin, CORS support is omitted (for obvious reasons) and no `Origin` key is added to the `Vary` header and naturally the Access-Control-Allow-Origin header is not emitted. However, the request does cache and if a request from another origin is made, it receives the cached item without the CORS data.

Proposed resolution

Technically, every route in Drupal is a CORS route since CORS will activate if an Origin header is passed in the request. So shouldn't the Origin key be added to the Vary response for every Drupal request? That way, upstream caches will variate their cache and miss if the origin header is present or different?


Viewing all articles
Browse latest Browse all 293561

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>