Dev.to
7/23/2026

The original title is: "A CORS Mismatch That Broke DocMind AI on a Fresh Netlify Deploy"
Original: A CORS Mismatch That Broke DocMind AI on a Fresh Netlify Deploy
Short summary
A RAG-based document chatbot called DocMind AI broke after a Netlify redeploy because the new site URL included a hyphen the backend's CORS allowlist didn't have. The browser silently blocked all requests before they reached the FastAPI backend, making it look like a broken deploy rather than a config mismatch. The fix was adding the new origin to the allow_origins list while keeping the existing narrow, explicit CORS configuration intact.
- •CORS allowlist must track the actual deployed origin, not the assumed one
- •Browser blocks unmatched-origin requests before server code runs, so backend logs show nothing
- •Keep narrow CORS config rather than falling back to wildcard origins for convenience
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



