Skip to content

fix(router): honor Cache-Control no-transform and strip modern digest headers when rewriting HTML (fixes #37) - #52

Closed
bigchungusai wants to merge 1 commit into
ubiquity:mainfrom
bigchungusai:fix/revision-footer-no-transform-digests-37
Closed

bigchungusai wants to merge 1 commit into
ubiquity:mainfrom
bigchungusai:fix/revision-footer-no-transform-digests-37

Conversation

@bigchungusai

Copy link
Copy Markdown

Fixes #37
/wallet 0xf36e02A6d81EdDAE7bcEAF6d7c1005099D54F488

Summary

  • Added src/utils/revision-footer.ts and wired decorateHtmlRevisionFooter into src/worker.ts so HTML responses are decorated with the router revision footer only when neither the request nor the response Cache-Control header contains no-transform.
  • Removed both modern digest headers (Content-Digest, Repr-Digest) alongside legacy representation validators (Content-Length, Content-MD5, Digest, ETag) whenever an HTML payload is rewritten.
  • Added regression tests in tests/revision-footer.test.ts covering no-transform in the request, no-transform in the response, and Content-Digest/Repr-Digest stripping on rewritten HTML.

Verification

  • bun test (23 passed across 3 files)
  • bun run type-check (tsc --noEmit)

Bounty Payout Wallet (Base / Ethereum / Gnosis / EVM): 0xf36e02A6d81EdDAE7bcEAF6d7c1005099D54F488
Bounty Payout Wallet (Solana SOL / USDC-SPL): HmrmUuXJiQpgYET15VZYcx5wceSRamjVTsewKqWNL3JC

@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 39f14176-83a2-4070-ace4-eed46269bc85
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ubiquity-os ubiquity-os Bot closed this Oct 25, 2026
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.

Honor no-transform and strip modern digest headers when rewriting HTML

1 participant