Repository navigation
上传幂等键兼容非安全上下文(纯 HTTP 直连) - #218
Merged
Merged
Conversation
Agent-Executor: pi-lead Agent-Session: pi-lead-1791429303659-4145181
Required Gate v2 — 状态面板当前状态:pass · 可合并 当前裁决: PR 累计主审轮(影子):
Gate 历史(v1;来源为持久化
|
| Run | Attempt | Head | 状态 | PR 累计主审轮(影子) | 收件人动作 |
|---|---|---|---|---|---|
| 38014945456 | 1 | 4c33aa1 |
pass |
1/5 · collecting |
可合并 |
历史行按 run_id + run_attempt 去重并只增不删;删除本评论后可由 gate_terminal 制品重建。
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.
问题
crypto.randomUUID()仅在安全上下文(HTTPS/localhost)可用。经纯 HTTP 入口(如 Tailscale 直连http://<ts-ip>:8200)打开页面时,生成幂等键直接抛crypto.randomUUID is not supported,上传无法提交。修复
generateUploadIdempotencyKey在randomUUID不可用时回退到crypto.getRandomValues(该 API 在非安全上下文可用)手工构造 UUID v4(版本位/变体位按 RFC 4122 设置);完全没有 Web Crypto 随机源时才报错。键格式<epoch_ms>-<UUID v4>不变,服务端契约无变化。测试
新增用例:移除
crypto.randomUUID(保留getRandomValues)后键仍符合 epoch_ms-UUID v4 格式。基线红验:无修复时该用例真实失败(旧代码抛错);修复后 17/17 通过。