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

ci: Use * instead of ['*'] #5428

Merged
merged 2 commits into from
Apr 18, 2024
Merged

ci: Use * instead of ['*'] #5428

merged 2 commits into from
Apr 18, 2024

Conversation

antonjoel82
Copy link
Contributor

What changed? Why was the change needed?

Unfortunately, this is still not working. While the origin code change seems to have been right anyway (yay!), it's still failing between the OPTIONS and POST requests...

Here are the logs for me logging into dev successfully (via dev.web.novu.co). You’ll notice that two requests have req.url: /v1/auth/login . However, when I search by that immediately after trying to login via the deploy-preview, I don’t see a log like that.

I see these logs that indicate that we are now doing the matching correctly during the OPTIONS request, but something is still going wrong after. I believe it's not responding correctly since I don't see Access-Control-Allow-Origin: * . Looking through the code, the only difference is setting origin: '' vs pushing '' onto the origins array... so trying that!

Copy link

netlify bot commented Apr 17, 2024

Deploy Preview for novu-design ready!

Name Link
🔨 Latest commit 611d1c6
🔍 Latest deploy log https://app.netlify.com/sites/novu-design/deploys/66206775912bb2000855c757
😎 Deploy Preview https://deploy-preview-5428--novu-design.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Apr 17, 2024

Deploy Preview for dev-web-novu ready!

Name Link
🔨 Latest commit 611d1c6
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/662067750a756600082fa9da
😎 Deploy Preview https://deploy-preview-5428--dev-web-novu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

['test', 'local'].includes(process.env.NODE_ENV) ||
isWidgetRoute(req.url) ||
isBlueprintRoute(req.url) ||
hasPermittedDeployPreviewOrigin(origin)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🗒 note (non-blocking): I felt this cleaned up the code to leverage the same pattern and reuse the origin that we know‏ is working

@antonjoel82 antonjoel82 merged commit c4c7e69 into next Apr 18, 2024
26 checks passed
@antonjoel82 antonjoel82 deleted the deploy-preview-cors-2 branch April 18, 2024 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants