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

Clone cached response before applying CORS headers #118

Merged
merged 2 commits into from
Sep 2, 2024

Conversation

damianstasik
Copy link
Collaborator

@damianstasik damianstasik commented Aug 30, 2024

The response returned from the cache is immutable, so attempting to attach additional headers throws an error. To resolve this, we need to create a fresh response based on the cached one and then set the CORS headers on it.

Copy link

cloudflare-workers-and-pages bot commented Aug 30, 2024

Deploying registry-ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6c6580e
Status: ✅  Deploy successful!
Preview URL: https://0d33aeba.registry-ui-dxi.pages.dev
Branch Preview URL: https://clone-cached-response-before.registry-ui-dxi.pages.dev

View logs

@damianstasik damianstasik force-pushed the clone-cached-response-before-applying-cors branch from 1fae782 to bdaddb0 Compare August 30, 2024 18:08
@damianstasik damianstasik requested a review from Yantrio August 30, 2024 18:11
@damianstasik damianstasik marked this pull request as ready for review August 30, 2024 18:11
@Yantrio Yantrio merged commit f8b3cfa into main Sep 2, 2024
4 checks passed
@Yantrio Yantrio deleted the clone-cached-response-before-applying-cors branch September 2, 2024 09:20
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