feat(app): add the per-plugin http client - #182
Merged
Merged
Conversation
Requests reach only the plugin's https hosts, redirects are followed by hand with every hop checked, cookies stay with the host that set them, and retries re-run auth, throttling and the network log per attempt.
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.
內容
M1 PR 8:網路層(ADR 0012 §決定 1–2、ADR 0011 §決定 4、ADR 0013 §決定 2/4;
.trellis/tasks/archive/2026-09/09-29-network-layer/prd.md)。lib/core/network/):攔截器依序是認證、cookie、錯誤對應、限流、網路紀錄。HttpClientAdapter可以替換,PR 9 的 fixture 錄製與重播接在這裡。https,而且只能連到允許清單內的網域或其子網域(以點為界)。百分比編碼的 host 一律拒絕。Domain涵蓋回應 host 且在允許清單內的 cookie。cookie_jar本身不檢查Domain,這點由檢查代理發現並修正。NetworkError;RateLimited;503 只有帶可以解析的Retry-After時才轉;AppError帶網路紀錄 id。AuthRequirement:三種標記的判斷,配上「沒有憑證」的來源。CredentialStore在 M3。Referer、User-Agent、Origin、Range,供 PR 10 使用。媒體 client 本身延到 M6:M1 沒有使用者,design §3 已記。AppError走report以帶出原因,層級一律是error。Review 指南
Location解析失敗時丟出非AppError;required請求仍會記一筆網路紀錄,AppError帶著它的 id。ignoreInvalidCookies維持預設 false,PR 9 接真實 B 站時觀察,已記在 M1 implement。驗證
app/:dart analyze --fatal-infos、flutter analyze乾淨;flutter test:303 過、1 跳過(live);fmp_lints86 過;測試一律用假的 adapter,不聯網。使用者看不到這些改動,真實連線在 PR 9 驗。