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:
@@ -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 {
|
||||
|
||||
@@ -28,7 +28,6 @@ export const httpCheckerSchemas: CheckerSchemas = {
|
||||
{
|
||||
headers: Type.Optional(stringMapSchema),
|
||||
maxBodyBytes: Type.Optional(sizeSchema),
|
||||
method: Type.Optional(httpMethodSchema),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user