Skip to content

Fix XHR domain rewriting for *.notion.site users#62

Merged
shigahi merged 1 commit intomasterfrom
fix/xhr-domain-rewriting
Feb 24, 2026
Merged

Fix XHR domain rewriting for *.notion.site users#62
shigahi merged 1 commit intomasterfrom
fix/xhr-domain-rewriting

Conversation

@shigahi
Copy link
Collaborator

@shigahi shigahi commented Feb 24, 2026

Summary

  • Fix client-side XMLHttpRequest override that hardcoded www.notion.so as the target domain
  • Replace with NOTION_SITE_DOMAIN so API calls are routed to the correct Notion backend (e.g., philipb.notion.site)
  • This was causing sites to crash for users whose Notion pages are hosted on *.notion.site domains

Root Cause

The XHR override in the generated Worker script rewrites URLs from the custom domain back to the Notion backend. It was hardcoded to www.notion.so, but users with personal Notion workspaces use *.notion.site domains. API calls were sent to the wrong server, causing the site to fail to load.

Related: #55

Test plan

  • Generate Worker code with a *.notion.site Notion URL and verify the XHR override uses the correct domain
  • Generate Worker code with a www.notion.so Notion URL and verify backwards compatibility
  • Verify npm run build succeeds

🤖 Generated with Claude Code

The client-side XMLHttpRequest override was hardcoded to rewrite
custom domain URLs to www.notion.so. For users whose Notion pages
are hosted on *.notion.site domains, this caused API calls to fail,
crashing the site. Use NOTION_SITE_DOMAIN instead.

Fixes #55

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@shigahi shigahi mentioned this pull request Feb 24, 2026
@shigahi shigahi merged commit 0489330 into master Feb 24, 2026
5 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.

1 participant