1
0

refactor: 移除 defaults.http.method 配置,简化默认值体系

- HTTP checker defaults schema 不再支持 method 字段
- resolve 逻辑从三级 fallback 简化为两级(target -> 内置默认)
- 配置文件中出现 defaults.http.method 将触发未知字段校验错误
- per-target http.method 覆盖功能保持不变
- 同步更新示例配置、README 文档和测试用例
This commit is contained in:
2026-05-16 21:45:08 +08:00
parent 04c24e6796
commit e924732a02
7 changed files with 29 additions and 51 deletions

View File

@@ -105,9 +105,9 @@ export class HttpChecker implements CheckerDefinition<ResolvedHttpTarget> {
const t = target as RawTargetConfig & { http: HttpTargetConfig; type: "http" };
const httpDefaults = context.defaults["http"] as
| undefined
| { headers?: Record<string, string>; maxBodyBytes?: string; method?: string };
| { headers?: Record<string, string>; maxBodyBytes?: string };
const method = t.http.method ?? httpDefaults?.method ?? "GET";
const method = t.http.method ?? "GET";
const maxBodyBytes = parseSize(t.http.maxBodyBytes ?? httpDefaults?.maxBodyBytes ?? "100MB");
return {