Skip to content

Forward compressed API request bodies unchanged - #177

Merged
shigahi merged 1 commit into
masterfrom
fix/compressed-api-body
Oct 22, 2026
Merged

shigahi merged 1 commit into
masterfrom
fix/compressed-api-body

Conversation

@shigahi

@shigahi shigahi commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #171.

The Notion client now sends gzip-compressed event batches to /api/v3/etClient (Content-Encoding: gzip). The worker read every /api/ request body with request.text() and did not forward Content-Encoding, so the bytes were corrupted and Notion answered 400 invalid_json. This made the daily render check fail with 400 /api/v3/etClient.

  • buildApiHeaders forwards content-encoding
  • Compressed /api/ bodies are forwarded as raw bytes; uncompressed JSON bodies keep the space-domain swap

Verification

Ran scripts/render-check.mjs locally against the live test page with request logging:

  • Before: every gzipped /api/v3/etClient request returned 400 {"code":"invalid_json"}
  • After: all /api/v3/etClient requests (gzipped and plain) return 200, no errors passes
  • npm run build passes

The remaining NOTION results (database views/rows, item click, navigation) also fail on notion.site itself, so they are not Worknot regressions.

The Notion client now gzips event batches sent to /api/v3/etClient. The
worker read every API body as text and dropped Content-Encoding, so Notion
rejected them with 400 invalid_json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shigahi
shigahi merged commit a068b39 into master Oct 22, 2026
5 checks passed
@shigahi
shigahi deleted the fix/compressed-api-body branch October 22, 2026 07:01
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.

Rendering regression detected - 2026-10-14

1 participant