fix(backend): Explicitly whitelist reported frontend origin in CORS config#25
fix(backend): Explicitly whitelist reported frontend origin in CORS config#25
Conversation
…onfig Co-authored-by: KnellBalm <90038472+KnellBalm@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates backend CORS configuration to explicitly whitelist the reported Cloud Run frontend origin, adding a clarifying comment without changing runtime behavior beyond ensuring the origin is clearly allowed and triggering redeploy. Sequence diagram for CORS preflight with explicit frontend originsequenceDiagram
actor User
participant Browser
participant Frontend_CloudRun as Frontend_CloudRun
participant Backend_CloudRun as Backend_CloudRun
User->>Browser: Open app URL
Browser->>Frontend_CloudRun: Load frontend (HTML, JS)
Frontend_CloudRun-->>Browser: Frontend assets
Browser->>Backend_CloudRun: OPTIONS /api (Origin: reported_frontend_origin)
Backend_CloudRun->>Backend_CloudRun: Check Origin against cloud_origins list
Backend_CloudRun-->>Browser: CORS headers (Access_Control_Allow_Origin: reported_frontend_origin)
Browser->>Backend_CloudRun: Actual API request (e.g. GET /api)
Backend_CloudRun-->>Browser: API response
Browser-->>User: Render data without CORS error
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Co-authored-by: KnellBalm <90038472+KnellBalm@users.noreply.github.com>
The user reported a CORS error for 'https://query-craft-frontend-758178119666.us-central1.run.app'. Although this origin was covered by the regex and the list, we explicitly re-added it to the list to ensure no subtle issues (e.g. invisible characters) and to force a redeployment of the backend service to ensure the latest configuration is active. Verified with local reproduction script and existing tests.
PR created automatically by Jules for task 16649199408041380953 started by @KnellBalm
Summary by Sourcery
Bug Fixes: