Skip to content

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

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

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

Conversation

@shigahi
Copy link
Collaborator

@shigahi shigahi commented Feb 27, 2026

Summary

  • Fix client-side XMLHttpRequest override to use NOTION_SITE_DOMAIN instead of hardcoded www.notion.so, resolving site crashes for users whose Notion pages are hosted on *.notion.site domains
  • Simplify code.ts: remove redundant variables, consolidate duplicate JS asset handlers and API proxy blocks, fix indentation

Fixes #55

Test plan

  • Generate a worker script with a *.notion.site URL and verify XHR rewrites use the correct domain
  • Generate a worker script with a www.notion.so URL and verify it still works correctly
  • Verify JS assets (/app*.js and /_assets/*.js) are served with correct Content-Type
  • Verify API endpoints (syncRecordValues, getPublicSpaceData, etc.) return rewritten responses

🤖 Generated with Claude Code

@shigahi shigahi merged commit e67efa7 into master Feb 27, 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.

Slug not working

1 participant