Skip to content

fix(site): unify Chrome 144 headers, HTTP/2, cookie hygiene, t.co meta-refresh, and Douyin webid persistence - #197

Merged
chialecode merged 7 commits into
mainfrom
fix/183-site-headers-transport-hygiene
Nov 29, 2026
Merged

chialecode merged 7 commits into
mainfrom
fix/183-site-headers-transport-hygiene

Conversation

@chialecode

Copy link
Copy Markdown
Owner

Closes #183

做了什么

按 issue #183 统一补齐哔哩哔哩、抖音、微博、X 四个站点的浏览器请求头指纹一致性、HTTP/2 传输协商、跨站 Cookie 隔离、短链解析、webid 持久化与登录/远程风险提示:

  1. 共享现代桌面 Chrome 浏览器配置(internal/site 纯 Go 标准库实现)

    • 新增 internal/site/browser_profile.go:BrowserProfile、DeriveBrowserProfile(ua)、ApplyClientHints(http.Header) 与 W3C Fetch 语义的 DeriveSecFetchSite(referer, targetURL),严格遵守 tools/check 依赖规则(internal/site 仅使用 Go 标准库)。
    • 全站默认桌面 Chrome UA 统一升级至 Chrome/144.0.0.0(Windows NT 10.0; Win64; x64,DefaultUserAgent 及 B 站/抖音/微博/X 同步),配套一致的 Sec-Ch-Ua / Sec-Ch-Ua-Mobile: ?0 / Sec-Ch-Ua-Platform: "Windows"。
    • 非 Chromium 保护:传入 Firefox/Safari 等非 Chromium UA 时,绝不伪造 Sec-Ch-Ua* 头部。
    • 保持抖音 a_bogus 黄金向量测试通过,所有站点与查询指纹参数共享同一套派生逻辑。
  2. 抖音(internal/site/douyin/、internal/credential/、internal/service/)

    • 修复跨站 Cookie 泄漏:ReflowRoomInfo 与 CheckRoomsAlive 对 webcast.amemv.com 设置 guestNoCookie: true,确保 .douyin.com Cookie 绝不发往 webcast.amemv.com(附回归测试断言 Cookie == "" 与 Sec-Fetch-Site: cross-site)。
    • 清理 ResolvePlayRedirect 请求头:对 /aweme/v1/play/ 改用独立的 applyPlayRedirectHeaders(Accept: */*、Accept-Language: zh-CN,zh;q=0.9、Referer: https://www.douyin.com/、Sec-Fetch-Mode: no-cors、Sec-Fetch-Dest: video,移除 Origin 与 JSON/CORS 头;仅对 *.douyin.com 附带所需会话 Cookie 并在任何非 douyin.com 主机上显式剔除 Cookie)。
    • 跨重启持久化 webid:在 credential.Record 增加向后兼容的可选字段 DouyinWebID string \json:"douyinWebId,omitempty"`(不改写 schema 版本,旧 douyin.bin无缝读取),新增DouyinWebID/SaveDouyinWebID/EnsureDouyinWebID并在internal/service/backend.go(覆盖桌面端与 internal/remoteserver/run.go)及 douyin.NewClient/LoginWithCookie接入,重新粘贴 Cookie 时保留同一webid`。
  3. X(internal/site/x/)

    • 动态 Sec-Fetch-Site:将硬编码的 Sec-Fetch-Site: same-origin 替换为基于 site.DeriveSecFetchSite 的动态计算,使 https://x.com/ → https://api.x.com/1.1/account/settings.json 发送 same-site,https://x.com/ → https://x.com/i/api/graphql/... 发送 same-origin。
    • abs.twimg.com 静态脚本请求头:fetchStaticAsset(含重定向每一跳)携带 Referer: https://x.com/、来自浏览器配置的 Sec-Ch-Ua*、Sec-Fetch-Site: cross-site、Sec-Fetch-Mode: no-cors、Sec-Fetch-Dest: script,同时继续严格剥离 Cookie / Authorization / X-Csrf-Token / X-Twitter-Auth-Type / X-Client-Transaction-Id / Origin。
    • t.co HTTP 200 HTML meta-refresh 与 JS fallback 支持:在 3xx Location 之外,支持有界读取(<= 64 KiB)HTTP 200 HTML 中的 <meta http-equiv="refresh" content="...;URL=..."> 及 location.replace("...") 回退跳转,复用严格的 HTTPS、SSRF/白名单域名校验、零 Cookie 与 5 跳上限。
  4. 微博(internal/site/weibo/)

    • weibo/client.go 接入共享 site.BrowserProfile 与 site.DeriveSecFetchSite,为 /ajax/* 与 /tv/api/component 补齐 Sec-Fetch-Site、Sec-Fetch-Mode: cors、Sec-Fetch-Dest: empty 与 Sec-Ch-Ua*(未触碰微博扫码登录相关范围)。
  5. 哔哩哔哩与媒体传输(internal/site/bilibili/、internal/credential/、internal/download/、internal/live/)

    • 恢复 HTTP/2 协商:为 B 站 apiTransport/mediaTransport 以及抖音/微博/X、下载与直播媒体 http.Transport 显式启用 ForceAttemptHTTP2: true。
    • 动态 Referer、Accept、Accept-Language、Sec-Fetch-* 与 POST Origin:
      • space.bilibili.com/<mid>、arc/search、feed/space、relation/followings、fav 使用 https://space.bilibili.com/<mid>/(无 mid 回退首页);
      • api.live.bilibili.com 使用 https://live.bilibili.com/;
      • wbi/view、playurl、player/wbi/v2 与 seg.so 弹幕在已知 bvid 时使用 https://www.bilibili.com/video/<bvid>/(DanmakuXML 扩展向后兼容的可变参数 bvid ...string);
      • HTML 页面(空间页、/correspond/1/...、b23.tv)发送 HTML Accept 与 navigate/document/?1(b23.tv 无 Referer、Sec-Fetch-Site: none、无 Cookie),seg.so 发送 Accept: */*,JSON 接口发送 application/json, text/plain, */* 与 cors/empty;
      • POST 接口(cookie/refresh、confirm/refresh)附带 Origin: https://www.bilibili.com。
    • 请求间隔抖动:在 B 站 500ms 串行间隔之上增加 0..200ms 可注入随机抖动(PacingJitterMax / PacingJitterFunc),单测保持确定性与快速执行。
    • 保留 B 站 buvid3、buvid4、b_nut:在 credential.AllowedCookieKeys 放行可选字段 buvid3、buvid4、b_nut(SESSDATA 仍为必填),并在 Store.RedactString 与 Manager.RedactString 中对原始/URL 编码/JSON 形式全面脱敏,附哨兵防泄漏单测。
  6. 登录页与远程设置风险提示文案(internal/ui/、docs/ui.md)

    • 在登录页(B 站/抖音/微博/X 粘贴凭证区)与设置 › 远程登录说明中补充简洁一致的提示:粘贴的 Cookie 与浏览器共用会话且不支持自动续期、高风控站点建议使用专门备用账号、避免本机与远程 VPS 对同一账号并发高频请求,并同步更新 docs/ui.md §3.7–3.8(保留 X 风险提示框全部必检短语与布局约束)。

验证

  • go run ./tools/check — ALL CHECKS PASSED(gofmt -l 345ms、go vet ./... 1.583s、go test ./... 全仓全部包通过含 internal/ui 237.558s、dependency direction 2.826s、trace-server linux build 26.146s、tools/checkdocs 1.905s、git diff --check HEAD 149ms)
  • go run ./tools/uishots -out artifacts/uishots — all passed(生成并断言通过全部 381 张截图,含 login-x 风险提示布局与全部 10 项文案断言)
  • CI repository-quality(建 PR 后由 GitHub Actions 自动运行)
  • 审核前在干净 PR 分支运行 go run ./tools/package -install 并供用户实测(由协调器在独立审查后安排)
  • not-run: 真实站点请求(本次实现与测试严格零真实站点请求,全部采用单元测试、合成样本、本地回环 httptest 与 ui.NewTester)
  • not-run: go test -race ./...(本机门禁与无 cgo Windows 构建环境默认 CGO_ENABLED=0)
  • 推送说明:因在 git worktree 中执行且本地已先跑通 go run ./tools/check,按 LESSONS.md chore(deps): bump golang.org/x/image from 0.47.0 to 0.48.0 in the minor-and-patch group #9 使用 git push --no-verify -u origin fix/183-site-headers-transport-hygiene 以避开 pre-push 中 GIT_DIR 与 tools/release 测试冲突。

风险

风险等级:高风险(已加 risk:high 标签,原因:修改了 internal/credential/ 凭证白名单、脱敏规则与 Record 可选持久化字段 douyinWebId;向后兼容旧 bilibili.bin / douyin.bin,无结构版本变更、无通道隔离变更,需经独立审查与审核前本机 trace-dev 安装并由用户测试后合并)。

每个提交都带 Signed-off-by(git commit -s)。

…a-refresh, and Douyin webid persistence

Signed-off-by: chialecode <315431287+chialecode@users.noreply.github.com>
@chialecode chialecode added the risk:high 碰了高风险清单,需要用户合并 label Nov 28, 2026
…transport-hygiene

Signed-off-by: chialecode <315431287+chialecode@users.noreply.github.com>

# Conflicts:
#	docs/ui.md
#	internal/site/douyin/auth.go
#	internal/site/douyin/client.go
#	internal/ui/login_view.go
@chialecode

Copy link
Copy Markdown
Owner Author

Agent:已合并最新 origin/main(merge commit 5d22746,已含 DCO 签名),完整保留 #189(Douyin cookie_ttwidinfo_webid 同步)、#195(Cookie 粘贴引导与实时预检)和 #185 改动,并确保 Douyin 持久化默认 webid 与 ttwid 绑定的服务端同步 webid 严格隔离。

合并后重新验证:

  • go run ./tools/check:ALL CHECKS PASSED in 11m3.653s(gofmt -l、go vet ./...、go test ./...、dependency direction、trace-server linux build、tools/checkdocs、git diff --check HEAD 全部通过;零真实站点请求)
  • go run ./tools/uishots -out artifacts/uishots:generated 396 screenshots (all passed)
  • 推送说明:独立 git worktree 环境中按 LESSONS.md chore(deps): bump golang.org/x/image from 0.47.0 to 0.48.0 in the minor-and-patch group #9 在本地 tools/check 通过后使用 git push --no-verify 推送。

…ter, harden meta-refresh and log redaction

Signed-off-by: chialecode <315431287+chialecode@users.noreply.github.com>
@chialecode

chialecode commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner Author

Agent:已修复独立审查指出的 4 项问题并补充回归测试(commit d7b2ee8f72b98e08e69b86224d1f7a1cdb800ae4,已含 DCO 签名):

  1. [P1] Douyin ReflowRoomInfo / CheckRoomsAlive:新增 omitCookie 并与 guestNoCookie 分离;未登录或凭据过期时严格经 RequireAuth 拒绝且零外发请求(同时覆盖 SelectLiveStream 的 19 位 room_id 路径),登录态下仍对 webcast.amemv.com 不携带 Cookie、不回写凭据、不解析 cookie_ttwidinfo_webid。
  2. [P1] Bilibili 抖动默认值:当调用方显式指定较小正数 PacingInterval 且 PacingJitterMax == 0 时,默认抖动按 min(200ms, pacing*2/5) 等比缩放(默认 PacingInterval == 0 仍保持 500ms + 0..200ms),修复 CI 中 TestMoveAccount* 竞态失败。
  3. [P2] X t.co parseMetaRefreshURL:改为 strings.Cut(content, ";") 仅在延时后切分一次,支持 URL 中含分号及 URL = 两侧空白,并剥离整体匹配引号。
  4. [P2] 运行日志脱敏:在 internal/service/logging.go 的 secretKeyNamesPattern 补齐 buvid3|buvid4|b_nut,覆盖冒号与等号写法。

验证证据(零真实站点请求):

  • go test ./internal/site/douyin ./internal/site/bilibili ./internal/site/x:PASS
  • go test -count=3 ./internal/ui -run TestMoveAccount:PASS (2.721s)
  • go run ./tools/check:ALL CHECKS PASSED in 6m20.906s(全部 46 包、dependency direction、trace-server linux build、tools/checkdocs、git diff --check HEAD)
  • 推送说明:按 LESSONS.md #9 在本地 tools/check 通过后于独立 worktree 使用 git push --no-verify 推送。

…transport-hygiene

Signed-off-by: chialecode <315431287+chialecode@users.noreply.github.com>
@chialecode

Copy link
Copy Markdown
Owner Author

Agent:独立代码审查(干净上下文,按 REVIEW.md 顺序与口径)完成,结论:可合并(本 PR 涉及 internal/credential,已标记 risk:high,技术审查与 CI 均通过,需由用户审核并合并)。

审查范围

  • 目标 PR:#197(fix/183-site-headers-transport-hygiene,Closes #183),审查提交:7dd39c71066e5312a1316ef4f485287e025956c0(共 52 个变更文件,包含复审修复 d7b2ee8f 以及无冲突合并最新 origin/main 的 7dd39c71)。
  • 除完整 diff 外,已阅读相关周边实现核对边界与不变量:internal/site/browser_profile.go、internal/site/{bilibili,douyin,weibo,x}/、internal/credential/{credential,douyin,weibo,manager}.go、internal/service/{backend,logging}.go、internal/remoteserver/run.go、internal/download/、internal/live/、internal/ui/{login_view,cookie_ux,remote_settings}.go 及 docs/ui.md。
  • CI 状态确认:repository-quality(4m7s)、Analyze (go)、Analyze (actions)、CodeQL、DCO 全部 pass,mergeable=MERGEABLE,标签 risk:high 已就位。

关键核查项

  • 共享浏览器档案与依赖方向:internal/site/browser_profile.go 严格仅使用 Go 标准库(遵守 tools/check 依赖规则);四站默认桌面 Chrome UA 统一升级为 Chrome/144.0.0.0 并联动 Sec-Ch-Ua* 与抖音查询指纹参数;非 Chromium UA 不会伪造且主动剥离 Sec-Ch-Ua*;抖音 a_bogus 黄金向量与 cmd/trace-server 无 GUI Linux 交叉编译均通过。
  • 抖音:
    • ReflowRoomInfo 与 CheckRoomsAlive 使用独立的 omitCookie: true(与仅用于对照检查的 guestNoCookie 分离),已登录时向 webcast.amemv.com 发送空 Cookie 与 Sec-Fetch-Site: cross-site(杜绝 .douyin.com Cookie 跨站泄漏),未登录或凭证过期时在 ReflowRoomInfo / CheckRoomsAlive / 19 位 SelectLiveStream 均严格拦截并返回 auth_required(零外发请求,守住 INV-07 / DEC-018 / DEC-043)。
    • ResolvePlayRedirect 使用 applyPlayRedirectHeaders(Accept: */*、Sec-Fetch-Mode: no-cors、Sec-Fetch-Dest: video、删除 Origin,仅对 *.douyin.com 带 Cookie)。
    • DouyinWebID 作为向后兼容可选字段持久化在 douyin.bin(不升 schema 版本),经 service.NewBackend 同时覆盖桌面端与 trace-server,重新粘贴 Cookie 时保持不变,并与 #189 绑定 ttwid 的 syncedWebID 清晰隔离。
  • X:动态计算 Sec-Fetch-Site(x.com -> api.x.com 为 same-site,x.com -> x.com 为 same-origin);abs.twimg.com 静态脚本在首跳与重定向跳均带 Referer: https://x.com/、Sec-Ch-Ua* 与 Sec-Fetch-Site: cross-site 并严格剥离全部认证与 CSRF 头;t.co HTTP 200 HTML 支持有界(<= 64 KiB)meta-refresh(单次 strings.Cut 保留 URL 内分号并兼容 url = 空白与引号)及 location.replace 回退,完整复用 HTTPS:443、白名单域名、零 Cookie、防原地循环与 5 跳上限。
  • 微博:接入共享 BrowserProfile 与动态 Sec-Fetch-Site/Mode/Dest,保持 t.cn 零 Cookie 导航头与既有协议边界。
  • 哔哩哔哩与媒体传输:apiTransport、mediaTransport 及下载/直播 http.Transport 显式启用 ForceAttemptHTTP2: true;按端点细分动态 Referer、Accept、Accept-Language 与 POST Origin;默认 500ms + 0..200ms 随机抖动,自定义正值 PacingInterval 按 min(200ms, pacing*2/5) 比例缩放;手动粘贴保留 buvid3/buvid4/b_nut(仍强制要求 SESSDATA)并在 internal/credential 与 internal/service/logging.go(secretKeyNamesPattern)两端均完整脱敏。
  • UI 与合并一致性:登录页、设置页与远程页补齐克制的共用会话/并发风险提示,与 origin/main 合并完整保留了 #189、#195、#185、#193 与 #201,uishots 全部通过。

未检查项(not-run)

  • 四站真实网络协议验证:not-run(本次审查与自动化测试均为本地合成 httptest 与单元测试,零真实站点请求)。
  • 本机开发版安装(go run ./tools/package -install):not-run(本机唯一的 TRACE Dev 安装位当前已安装同批次高风险 PR #187 的 0.1.3-dev.202611281111 供用户实测;可在用户审核合并 #187 后或按用户要求立即切换安装 #197 并补发安装回执)。

阻塞问题

  • 无(首轮独立审查提出的 2 项 P1 与 2 项 P2 问题均已在 d7b2ee8f 修复并补充回归测试,CI repository-quality 已全绿通过)。

非阻塞建议(供后续参考)

  1. 后续若继续排查辅助传输连接复用,可按需评估 internal/site/image_cdn_fallback.go 等辅助 http.Transport 是否统一启用 ForceAttemptHTTP2: true。
  2. internal/site/bilibili/dynamic.go 的 DynamicDetail 在拼接 Referer 时目前直接使用已去空白的 dynID,后续若放开非数字动态 ID 可顺手做格式校验或路径转义。

…t-hygiene

Signed-off-by: chialecode <315431287+chialecode@users.noreply.github.com>
…race

Signed-off-by: chialecode <315431287+chialecode@users.noreply.github.com>
@chialecode

Copy link
Copy Markdown
Owner Author

Agent:已将分支 fix/183-site-headers-transport-hygiene 同步至最新 origin/main(f61d6866,含 PR #199 / #203 / #205;合并提交 87936688,无冲突),并修复独立审查指出的 3 处仅限测试的数据竞争(提交 0529d01a,未改动任何生产代码、未弱化任何断言):

  1. internal/service/douyin_auth_test.go(TestNewBackendPersistsDouyinWebIDAcrossRestarts):为 seenWebIDs 读写补充 sync.Mutex 保护并在断言前持锁复制快照。
  2. internal/site/bilibili/headers_hygiene_test.go(TestBilibiliDynamicHeadersOriginAndNonChromiumGuard):新增持锁 getSeen 读取辅助函数,所有 seen[...] 断言改为持锁读取。
  3. internal/site/weibo/client_errors_test.go(TestWeiboSecFetchAndNonChromiumHeaders):为 ajaxHeaders/tvHeaders 的写入、重置与断言读取补充 sync.Mutex 保护。

验证

  • go run ./tools/check(退出码 0,ALL CHECKS PASSED in 3m56.805s,覆盖 gofmt、go vet ./...、go test ./...、依赖方向、trace-server Linux amd64/arm64 构建与 GOOS=linux go vet ./...、tools/checkdocs、git diff --check HEAD)。
  • 推送说明:本次在独立 git worktree 内执行,按 LESSONS.md 先完整通过 go run ./tools/check 后使用 git push --no-verify 推送,避免 pre-push 钩子注入 GIT_DIR 干扰 tools/release 测试仓库操作。
  • go test -race:本机 Windows 无 CGO 工具链(not-run),等待 GitHub Actions Ubuntu CI repository-quality(-race)与 CodeQL / DCO 自动验证当前头提交 0529d01a7dc2dea3bb63b7abc8f5f19179281e7a。

chialecode added a commit that referenced this pull request Nov 29, 2026
…-race and test ordering flakes (#209)

Closes #208

## 做了什么

修复 Ubuntu CI `go test -race` 暴露的 5 处已存在于
`main`(`f61d6866`)的仅限测试的并发/时序缺陷(不修改任何生产代码,不弱化任何非 `-race` 断言):

1.
**`internal/player/player_test.go`、`internal/player/live_preview_test.go`**:引入基于
`sync.Mutex` 的 `syncTestClock` 辅助类型(保留 `time.Time` 单调时钟与时区语义),全面审计并替换
`internal/player/*_test.go` 中全部 3 处 `NullAudioSink.NowFunc` 未同步 `now`
闭包捕获:
-
`TestOpenLivePreviewGrowingHLSAndFLVFMP4AndDanmakuSuppressed`(`live_preview_test.go:242-243,280,306,335`,曾于
PR #197 CI run `46246425655` 触发 `-race` 失败)
-
`TestEndToEndLiveRecorderAndPlayerPreviewFinalizeWithoutHandleConflict`(`live_preview_test.go:658-659,670`,同类
`LoadLiveDecoder` + `runVideoWorker` 并发读写风险)
-
`TestPureAudioControllerClockSeekPreviewVolumeAndEOF`(`player_test.go:273-275,305,319,352`,统一使用同步假时钟消除未同步模式)
2. **`internal/service/preview_media_test.go:181`**:将
`TestStagePreviewMediaStreamingLimitCancelAndVideoFriendlyErrors` 的
`chunkSent := make(chan struct{})` 改为缓冲容量 1 的 `make(chan struct{},
1)`,修复 HTTP 处理协程非阻塞发送早于测试主协程进入 `select` 时的丢唤醒超时(曾于 PR #194 CI run
`46246187044` 失败)。
3.
**`internal/library/race_disabled_test.go`、`internal/library/race_enabled_test.go`、`internal/library/batch_storage_test.go:368`**:沿用
PR #203 规范区分 `//go:build !race` 与 `//go:build race`;非 `-race` 保持严格 `2s`
预算,`-race` 下放宽至 `10s`,修复纯 Go SQLite 在 `-race` 插桩下查询 5,000 条记录约 `2.1s`
的超时误报(PR #194 run `46246187044` attempt 2 报 `2.077s`、本 PR run
`46248609653` 报 `2.130s`)。
4.
**`internal/download/weibo_download_test.go:1549`**:`waitForTaskTerminal`
在轮询到数据库终态的同时加锁确认 `mgr.activeRun[taskID]` 已清理,确保工作协程同步清理完
`activeProbeSite` 后才返回,修复
`TestManualTasksDuringBackoffRespectSingleProbeCapAndNotifyFailure`
紧随其后调用 `RetryActionable` 时因 `activeProbeSite` 尚未清除而跳过探测标记的时序竞态(本 PR run
`46248609653`)。
5.
**`internal/service/event_coalescing_and_lock_safety_test.go`**:`TestWeiboBackfillTierABatchCoalescesLibraryEvents`
两个子测试同时等待 `EventCacheQueueUpdated` 完成通知(严格在 `backfill.go:870-871` 的
`publishBackfillBatchLibraryChanged` 之后触发)再检查
`libEvents`,消除解锁后事件尚未发布即读取导致的 `published 0 EventLibraryChanged events`
时序竞态(本 PR run `46248609653`),零任意休眠且完全保留 `len(got) == 1` 严格断言。

未找到本地参考索引(`tools/checkdocs` 实测)。

## 验证

- [x] `go test -count=3 ./internal/player`(退出码 `0`,`19.629s`,3 轮全通过)
- [x] `go test -count=5 -run
TestStagePreviewMediaStreamingLimitCancelAndVideoFriendlyErrors
./internal/service`(退出码 `0`,`0.760s`,5 轮全通过)
- [x] `go test -count=3 -run
TestStatisticsAuthorItemCountAndBytesWithViaAnd5000Items
./internal/library`(退出码 `0`,`1.001s`)
- [x] `go test -count=3 -run
TestManualTasksDuringBackoffRespectSingleProbeCapAndNotifyFailure
./internal/download`(退出码 `0`,`1.700s`)
- [x] `go test -count=5 -run
TestWeiboBackfillTierABatchCoalescesLibraryEvents
./internal/service`(退出码 `0`,`5.811s`)
- [x] `go run ./tools/check`(退出码 `0`,`ALL CHECKS PASSED in 4m3.295s`,覆盖
`gofmt`、`go vet ./...`、`go test ./...`、依赖方向、`trace-server` Linux
`amd64`/`arm64` 构建与 `GOOS=linux go vet ./...`、`tools/checkdocs`、`git
diff --check HEAD`)
- [x] GitHub Actions `repository-quality`(run `46251007067`,`13m15s`,含
Ubuntu `go test -race` 全部 48 包 0 竞态)、`Analyze (actions)`(`38s`)、`Analyze
(go)`(`1m50s`)、`CodeQL`(`2s`)、`DCO`(`1s`)在当前头提交
`bbbd44cee04dd58826bc66c8b761392ac97cbf97` 全部通过
- [x] 独立审查覆盖 `bbbd44cee04dd58826bc66c8b761392ac97cbf97`
并通过(`#issuecomment-7254278140`,0 P0/P1/P2,可合并)
- `go test -race`:`not-run`(本机 Windows 无 CGO 工具链),已由 Ubuntu CI
`repository-quality`(run `46251007067`)全量验证通过。
- 推送说明:本次在独立 `git worktree` 工作树内执行,按 `LESSONS.md` 规则先单独完整通过 `go run
./tools/check` 后使用 `git push --no-verify` 推送,避免 `pre-push` 钩子注入
`GIT_DIR` 干扰 `tools/release` 测试仓库操作。

## 风险

风险等级:低风险

- 仅修改/新增测试文件(共 8 个 `*_test.go` 文件),零生产代码变更,未删除或弱化任何非 `-race`
断言,不涉及高风险清单(`docs/dev-rules/workflow.md#high-risk`)。

每个提交都带 `Signed-off-by`(`git commit -s`)。

---------

Signed-off-by: chialecode <315431287+chialecode@users.noreply.github.com>
…t-hygiene

Signed-off-by: chialecode <315431287+chialecode@users.noreply.github.com>
@chialecode

Copy link
Copy Markdown
Owner Author

Agent:已将分支 fix/183-site-headers-transport-hygiene 同步至最新 origin/main(b92caeb9,含 PR #207 DEC-099 与 PR #209 #208;合并提交 b7c1e4625a7749c4031e69f58d4206b3b8b75434),解决与 PR #207 的 2 处文本冲突:

  1. docs/ui.md:保留 origin/main 新增的「设置 › 网络」DEC-099 站点请求额度与策略描述,同时完整保留本 PR 在「设置 › 远程」新增的高风控账号与并发共享会话提示。
  2. internal/site/bilibili/client.go:融合 PR feat(settings): increase X hourly quota and add configurable per-site request policies #207 的并发安全 SetPacing / Pacing(paceMu 保护、entropy 随机数源、兼容 JitterMax 别名)与本 PR 的 PacingJitterMax / PacingJitterFunc 可注入抖动及按自定义间隔比例缩放默认抖动(waitPacing 仅在非首请求时采样抖动)。

验证

  • go run ./tools/check(退出码 0,ALL CHECKS PASSED in 8m33.678s,含 gofmt、go vet ./...、go test ./...、依赖方向、trace-server Linux amd64/arm64 构建与 GOOS=linux go vet ./...、tools/checkdocs、git diff --check HEAD)。
  • 推送说明:本次在独立 git worktree 内执行,按 LESSONS.md 先完整通过 go run ./tools/check 后使用 git push --no-verify 推送,避免 pre-push 钩子注入 GIT_DIR 干扰 tools/release 测试仓库操作。
  • go test -race:本机 Windows 无 CGO 工具链(not-run),等待 GitHub Actions Ubuntu CI repository-quality(-race)、CodeQL 与 DCO 验证 b7c1e4625a7749c4031e69f58d4206b3b8b75434。

@chialecode
chialecode merged commit 95051ce into main Nov 29, 2026
5 of 7 checks passed
@chialecode
chialecode deleted the fix/183-site-headers-transport-hygiene branch November 29, 2026 11:36
chialecode added a commit that referenced this pull request Nov 29, 2026
Signed-off-by: chialecode <315431287+chialecode@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high 碰了高风险清单,需要用户合并

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(site): 统一四站桌面浏览器档案并修复跨站 Cookie 泄漏、请求头、HTTP/2、短链与持久化细节

1 participant