Skip to content

fix(router): honor Cache-Control no-transform and strip modern digest headers on HTML rewrite (#37) - #53

Closed
harmweber787-png wants to merge 1 commit into
ubiquity:mainfrom
harmweber787-png:fix/issue-37-no-transform-digest-headers
Closed

harmweber787-png wants to merge 1 commit into
ubiquity:mainfrom
harmweber787-png:fix/issue-37-no-transform-digest-headers

Conversation

@harmweber787-png

Copy link
Copy Markdown

Closes #37

Summary

  • Add src/utils/revision-footer.ts (hasNoTransformDirective, shouldDecorateHtmlResponse, REWRITTEN_HTML_REMOVED_HEADERS, decorateHtmlRevisionFooter) and wire it into src/worker.ts:
    1. Skip HTML revision footer decoration whenever either the incoming request or the upstream response carries a Cache-Control: no-transform directive.
    2. Strip modern RFC 9530 representation digest headers (content-digest, repr-digest, want-content-digest, want-repr-digest) alongside legacy validators (content-length, content-md5, digest, want-digest, etag) whenever the HTML payload is rewritten.
  • Add regression tests in tests/revision-footer.test.ts covering no-transform in the request, no-transform in the response, and Content-Digest / Repr-Digest removal.

@ubiquity-os ubiquity-os Bot closed this Oct 26, 2026
@coderabbitai

coderabbitai Bot commented Oct 26, 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: 0a40395c-dcd0-4d8b-8b12-46838781a31a
  • 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.

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