Skip to content

fix: route migrated content through the DA compatibility bridge - #34

Merged
kptdobe merged 3 commits into
mainfrom
feat/hlx6-legacy-content-bridge
Nov 24, 2026
Merged

kptdobe merged 3 commits into
mainfrom
feat/hlx6-legacy-content-bridge

Conversation

@kptdobe

@kptdobe kptdobe commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Companion to adobe/da-admin#344.

Route sites in HLX6_MIGRATED_SITES through the existing daadmin service binding before IP allowlists or image opt-outs can read legacy R2. Sources still configured for dual write retain their existing routing.

Behavior

  • Preserve lowercase/document/index normalization and cookie/header/query-token authentication.
  • Keep .gimme_cookie, SVG download handling and CORS on the content host.
  • Support conditional GET/HEAD and stream upstream bodies while preserving ETag, Last-Modified, cache controls and error details.
  • Fail explicitly on malformed migration-variable JSON instead of falling back to R2.
  • Never substitute a service token, redirect the browser to another host or retry a denied/failed read against old storage.

Rollout and compatibility

Deploy adobe/da-admin#344 first. Set identical HLX6_MIGRATED_SITES and HLX6_DUAL_WRITES dashboard values on both workers; keep them out of Wrangler vars so keep_vars can preserve configuration.

Previously public direct-R2 requests still need valid HLX6 authorization after migration. This change does not grant anonymous authoring access. Content-host mutations remain unsupported; supported source/config saves go through da-admin.

Validation

  • npm test -- --reporter dot: 87 passing.
  • npm run lint: passed.
  • Regression cases cover allowlist/asset bypass prevention, dual-write mapping, invalid configuration, conditional HEAD and upstream failures.
  • No deployment or production mutation performed.

Prevent allowlists and image opt-outs from reading stale R2.
Preserve legacy URL/auth handling and conditional metadata.

Deploy the da-admin bridge first and synchronize migration lists.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@bosschaert bosschaert left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but to get the tests to pass you need to get the coverage up 😄

Normalize percent-encoded and dot path segments before migration checks,
cache parsed migration lists, preserve CORS headers on error responses,
only forward upstream content-length on HEAD, and cover all branches.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kptdobe
kptdobe merged commit 2da04b6 into main Nov 24, 2026
3 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.

2 participants