fix(csp): allow ask-trinity Cloud Function in connect-src (#1224)#1226
Merged
Conversation
) The in-app Help chat widget (HelpChatWidget.vue) fetches the public docs Q&A Cloud Function, but the prod and dev Content-Security-Policy connect-src directives only allowed 'self' ws: wss: — so the browser blocked every request with "Refused to connect ... violates CSP" and the widget failed with TypeError: Failed to fetch. Add the specific Cloud Function origin (narrow allowlist, no wildcard) to connect-src in both CSP sources: - src/frontend/security-headers.conf (prod nginx) - src/frontend/vite.config.js (dev server) ws:/wss: preserved, so WebSocket real-time delivery is unaffected. Verified the endpoint returns permissive CORS (ACAO: *, POST/OPTIONS, Content-Type) and answers HTTP 200 to the widget's {question} schema, so no CORS preflight surfaces as a follow-on blocker. Fixes #1224 Co-authored-by: Eugene Vyborov <eugene@beingluminous.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Direct-to-
mainhotfix for the P0 Help chat (Ask Trinity) CSP block. Same change as #1225 (merged todev), cherry-picked onto amain-based branch so it lands on production without dragging in dev's other unreleased commits.Adds the specific docs Q&A Cloud Function origin to
connect-srcin the prod (security-headers.conf) and dev (vite.config.js) CSP — narrow allowlist, no wildcard, no public-surface expansion.Test Plan
ws:/wss:preserved — WebSocket delivery unaffectedENDPOINTOPTIONS→204,ACAO: *,POST, OPTIONS,Content-Type); endpoint answersHTTP 200to the widget's{question}schemamainis the two CSP files onlyFixes #1224
🤖 Generated with Claude Code