Chrome Not sending origin Header on CrossSide

Viewed 3185

I'm developing an App with the latest Angular as Front-End and Symfony + Apache on the server. App and Server are on different domains, but my Server is allowing it by sending the needed CORS Headers (created by NelmioCors Bundle). But Chrome is not sending an Origin Header, which triggers the Bundle to send the Headers.

Somehow when I call the page with STRG+SHIFT+R it loads without problems.

Setting Vary: Origin did not help.

Why is chrome caching the request without the Allow Origin Header/ Not sending Origin in the first place?

2 Answers

Chrome is reusing a response to a request made earlier at a time when CORS headers were not set.

On a side note, using Vary: Origin in your response will prevent any future mishaps. However, you will need to set it on every response CORS or not.

FYI: using CTL+SHIFT+R triggers a hard reload and does not use the cache.

So, I'm to too sure what resolved the problem, but it seems like a complete reset of Chrome did the job.

Related