Skip to content

fix(map): proxy carto style requests to bypass CORS mismatch#18

Merged
ronload merged 1 commit into
mainfrom
fix/map-cors-proxy
Apr 15, 2026
Merged

fix(map): proxy carto style requests to bypass CORS mismatch#18
ronload merged 1 commit into
mainfrom
fix/map-cors-proxy

Conversation

@ronload

@ronload ronload commented Apr 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • Carto CDN returns Access-Control-Allow-Origin: http://zipkit.app (HTTP) instead of https://zipkit.app (HTTPS), causing CORS failures in production
  • Add Next.js rewrite to proxy /map-styles/* to basemaps.cartocdn.com/gl/*, making style.json requests same-origin
  • Update map component default style URLs to use the local proxy path

Test plan

  • pnpm dev -> open DevTools Network tab -> confirm style requests go to /map-styles/... and return 200
  • Verify map renders correctly in both light and dark themes
  • Deploy to preview -> confirm no CORS errors in console

Carto CDN returns Access-Control-Allow-Origin with http:// instead of
https://, causing CORS failures on production. Route style.json requests
through a Next.js rewrite so the browser makes same-origin requests.
@vercel

vercel Bot commented Apr 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
zipkit Ready Ready Preview, Comment Apr 15, 2026 9:45am

@ronload ronload merged commit acdcb73 into main Apr 15, 2026
2 of 3 checks passed
@ronload ronload deleted the fix/map-cors-proxy branch April 15, 2026 10:29
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.

1 participant