Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add CORs headers to cache hit responses #53

Closed
wants to merge 1 commit into from

Conversation

pirtleshell
Copy link
Member

if CORs is enabled in the underly nginx proxy, it adds necessary CORs headers to the response.

when the proxy service finds a cache hit, it does not add any CORs related header (or any of the originally cached request's response headers). thus, on cache hits, responses that would otherwise be allowed by CORs are rejected.

as a temporary fix to this, i've added appropriate CORs headers to all responses from cache hits. long-term, some response headers should get cached with the result data.

Copy link
Contributor

@galxy25 galxy25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets cache and use a (whitelisted set of) response headers from the cached response so that we return all headers needed by web clients (e.g. some browsers or extension may require a more constrained allowed origin)

@pirtleshell pirtleshell closed this Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants