Skip to content

fix(csp): allow ask-trinity Cloud Function in connect-src (#1224)#1226

Merged
vybe merged 1 commit into
mainfrom
hotfix/1224-help-chat-csp-main
Jun 16, 2026
Merged

fix(csp): allow ask-trinity Cloud Function in connect-src (#1224)#1226
vybe merged 1 commit into
mainfrom
hotfix/1224-help-chat-csp-main

Conversation

@vybe

@vybe vybe commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Direct-to-main hotfix for the P0 Help chat (Ask Trinity) CSP block. Same change as #1225 (merged to dev), cherry-picked onto a main-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-src in 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 unaffected
  • Allowlisted origin exactly matches the widget's hardcoded ENDPOINT
  • CORS preflight verified (OPTIONS204, ACAO: *, POST, OPTIONS, Content-Type); endpoint answers HTTP 200 to the widget's {question} schema
  • Diff vs main is the two CSP files only

Fixes #1224

🤖 Generated with Claude Code

)

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>
@vybe
vybe merged commit c2499e2 into main Jun 16, 2026
11 checks passed
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.

bug: Help chat (Ask Trinity) blocked by CSP — connect-src omits ask-trinity Cloud Function

1 participant