envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
24.72k stars 4.76k forks source link

Should envoy add "Vary: Origin" response header by default? #35873

Open rinfx opened 2 weeks ago

rinfx commented 2 weeks ago

Imagine the following situation:

If envoy add Vary: Origin response header by default, this error can be avoid.

Should envoy add "Vary: Origin" response header by default?

ggreenway commented 2 weeks ago

cc @wbpcode @daixiang0

johnlanni commented 6 days ago

Yes, I think this is very important. This article introduces this scenario: https://medium.com/@anonrongbo/understanding-the-importance-of-vary-origin-to-prevent-cache-confusion-and-cors-errors-ef3b63046b00

For example, gateways such as Spring Cloud Gateway and Zuul also implement this mechanism.