-
Notifications
You must be signed in to change notification settings - Fork 97
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
feat: cache cors requests #2048
Conversation
In production, |
Same goes for |
That being said, it should be possible to add a global CORS rule to our api ingress. |
Yes, thats my TODO for tomorrow. |
@@ -85,8 +85,9 @@ export default async function app( | |||
|
|||
app.register(helmet); | |||
app.register(cors, { | |||
origin: isProd ? /daily\.dev$/ : true, | |||
origin: isProd ? /^(?:https:\/\/)?(?:[\w-]+\.)*daily\.dev$/ : true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before it would allow adaily.dev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, otherwise we'd have to buy *daily.dev domains there are 💸
front will again ping
api.
and so introducing caching for cors requests dailydotdev/apps#3332/v1/a
does not supportOPTIONS
method so CORS fails/e
already supports CORS/scrape
does not supportOPTIONS
method so CORS fails