( value: unknown, source: string, warnings: HttpImportWarning[], )
| 75 | } |
| 76 | |
| 77 | export function normalizeHttpMethod( |
| 78 | value: unknown, |
| 79 | source: string, |
| 80 | warnings: HttpImportWarning[], |
| 81 | ): HttpMethod | null { |
| 82 | const method = typeof value === 'string' ? value.toUpperCase() : 'GET' |
| 83 | |
| 84 | if (SUPPORTED_METHODS.has(method as HttpMethod)) { |
| 85 | return method as HttpMethod |
| 86 | } |
| 87 | |
| 88 | addWarning(warnings, source, `Unsupported HTTP method "${method}" skipped`) |
| 89 | return null |
| 90 | } |
| 91 | |
| 92 | function decodeQueryPart(value: string): string { |
| 93 | try { |
no test coverage detected