(rawProtocol: string)
| 193 | } |
| 194 | |
| 195 | function normalizeProtocol(rawProtocol: string): "http" | "https" | null { |
| 196 | const normalized = rawProtocol.trim().toLowerCase().replace(/:$/, ""); |
| 197 | if (normalized === "http" || normalized === "https") { |
| 198 | return normalized; |
| 199 | } |
| 200 | |
| 201 | return null; |
| 202 | } |
| 203 | |
| 204 | function buildOrigin(protocol: string, host: string): string | null { |
| 205 | const normalizedProtocol = normalizeProtocol(protocol); |
no outgoing calls
no test coverage detected