fix(api): open CORS on /attribution/identify (browser SDK was blocked for hosted tenants)#38
Merged
Merged
Conversation
The browser SDK's stitch call comes from the BRAND'S OWN website origin (acme.com) — never in our allowlist — so identify() was CORS-blocked for every hosted tenant unless ops hand-added their site to CORS_EXTRA_ORIGINS. The endpoint is deliberately unauthenticated, rate-limited, cookie-free, and returns nothing sensitive, so it gets analytics-collector CORS: any origin, NO credentials. Every other route keeps the strict allowlist + credentials (pinned by test). Co-Authored-By: Claude Fable 5 <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.
Found while writing the brand integration docs: the browser SDK posts
/attribution/identifyfrom the brand's own website origin, which is never in our CORS allowlist — so the documented browser integration silently could not work on hosted tenants without ops adding every brand site toCORS_EXTRA_ORIGINS.Fix: analytics-collector CORS for exactly this path (any origin, no credentials) — the endpoint is deliberately unauthenticated, IP-rate-limited, reads no cookies, and returns nothing sensitive. All other routes keep the strict allowlist + credentials; a test pins both sides (open on identify incl.
/t/<slug>/+/api/t/<slug>/shapes, closed elsewhere).🤖 Generated with Claude Code