Repository navigation
feature/md-2326-allow-multi-domains-per-worker - #44
Draft
filipe-boleto wants to merge 1 commit into
Draft
filipe-boleto wants to merge 1 commit into
filipe-boleto wants to merge 1 commit into
Conversation
filipe-boleto
force-pushed
the
feature/md-2326-allow-multi-domain-per-worker
branch
from
August 10, 2026 13:27
ef15c77 to
4110bbf
Compare
filipe-boleto
requested review from
JFL110 and
benney
and
a balanced review from Copilot
and removed request for
benney
August 10, 2026 13:27
There was a problem hiding this comment.
Pull request overview
Adds multi-domain host routing while preserving existing single-domain behavior.
Changes:
- Adds validated domain maps with per-domain origins, surfaces, and secrets.
- Refactors proxy construction and Cloudflare HTML rewriting.
- Adds configuration documentation, examples, metadata, and tests.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
worker-configuration.d.ts |
Types the optional domain map binding. |
src/domainMap.ts |
Parses, validates, and resolves domain configurations. |
src/proxyConfig.ts |
Builds single- or multi-domain proxies. |
src/htmlRewriter.ts |
Extracts the Cloudflare HTML adapter. |
src/index.ts |
Uses the refactored proxy factory. |
test/domainMap.spec.ts |
Tests domain-map utilities. |
test/proxyConfig.spec.ts |
Tests host routing and unknown hosts. |
README.md |
Documents multi-domain setup. |
package.json |
Adds deployment binding metadata. |
config/domain-map.example.json |
Provides an example domain map. |
Suppressed comments (1)
src/domainMap.ts:146
- An explicitly configured
DOMAIN_MAP: {}is treated as if the binding were absent, soresolveConfigSourcebypasses this module's empty-map validation and silently falls back to single-domain mode. If legacy single-domain variables remain set, attached hosts can then be proxied to that origin instead of failing closed. Treat any object binding as present and update the corresponding test so{}reachesloadDomainMapand is rejected.
if (typeof raw === 'object' && !Array.isArray(raw)) return Object.keys(raw).length > 0
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+57
to
+60
| if (lower.startsWith('[')) { | ||
| const end = lower.indexOf(']') | ||
| return end === -1 ? lower : lower.slice(1, end) | ||
| } |
Comment on lines
+31
to
+33
| originUrl: entry.originUrl, | ||
| surfaceSlug: entry.surfaceSlug, | ||
| mosSecretKey: entry.mosSecretKey, |
Member
|
Why this and not just use the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.