feat: add host-specific Cloudflare analytics tokens - #6
Merged
Conversation
…alization Address review findings on the host-specific Cloudflare analytics feature: - Pre-render one index page per possible token (default token, each host token, and the empty/no-beacon page) at router setup, so the SPA fallback only does a host->token lookup per request instead of rebuilding and copying the whole page each time. Disabled/single-token modes now do zero per-request page allocation, matching the pre-feature behavior. - Consolidate host normalization into a single normalizeCloudflareWebAnalyticsHost helper used by both the config parser and the request matcher, and move the parser into the router package as ParseCloudflareWebAnalyticsHostTokens so the feature lives in one package. The parse test moves with it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
5 tasks
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.
English template:
.github/PULL_REQUEST_TEMPLATE/en.mdImportant
🔗 关联任务 / Related Issue
新功能请填写下方 Issue 编号;若还没有对应 Issue,请先自行创建。功能讨论请放在 Issue 中进行。
改动较大或方向性变更,请先在关联 Issue 中与维护者达成一致,再提交 PR。
Bug 修复请关联对应 Issue。设计取舍、理解偏差或预期不一致,更适合作为讨论或功能请求。
Closes #
🚀 变更类型 / Type of change
📝 变更描述 / Description
(简述做了什么、为什么生效。如果难以简述,建议先拆分范围,或在 Issue 中与维护者对齐。)
📸 运行证明 / Proof of Work
(请写明如何验证:实际步骤与观察结果。UI 变更请附截图或录屏;Bug 修复请说明复现过程与修复后结果。)
✅ 提交前检查项 / Checklist
New feature,我已关联对应 Issue;若尚无 Issue,我已先自行创建。