expressjs / expressjs/cors

Add ability to omit `Vary: Origin` header

Open
#317 6 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
JavaScript
Stars
6.2k
Forks
512
PR merge metrics
No merged PRs in 30d

Description

Hello! Thank you to the authors and maintainers for this important package.

We have an issue where we would like the ability to _conditionally_ omit `Vary: Origin` as a header. In our use case, we have specific routes for which the responses does not vary based on the requesting origin, e.g. a route for vending static image content.

Without this functionality, we are unable to use Cloudflare Polish[^1], which only accepts `Vary: Accept-Encoding`[^2], short of effectively rewriting all the `cors` code minus the `Vary: Origin` header.

Would this repository be able to add this functionality, or accept a patch to allow conditionally removing this header based on the requested routes?

Thank you again!

[^1]: https://developers.cloudflare.com/images/polish/
[^2]: https://developers.cloudflare.com/images/polish/cf-polished-statuses/

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.