You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In particular, consider what happens if Vary is not used and a server is configured to send Access-Control-Allow-Origin for a certain resource only in response to a CORS request. When a user agent receives a response to a non-CORS request for that resource (for example, as the result of a navigation request), the response will lack Access-Control-Allow-Origin and the user agent will cache that response. Then, if the user agent subsequently encounters a CORS request for the resource, it will use that cached response from the previous non-CORS request, without Access-Control-Allow-Origin.
Prerequisites
Fastify version
4.24.3
Plugin version
8.5.0
Node.js version
20.10.0
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
11
Description
The Fetch standard says:
fastify/cors seems to always define the
Access-Control-Allow-Origin
iforigin
is*
or a string, and in that case settingVary
sounds like a bug.Seems the regressor is #45.
Steps to Reproduce
fastify-cors.js
node fastify-cors.js
Vary
header is set asOrigin
even for the simple browser navigation.Expected Behavior
Vary
should not be set for simple cases.The text was updated successfully, but these errors were encountered: