(headers: Record<string, string>)
| 239 | |
| 240 | // Remove headers that should not be included like connection, host, etc |
| 241 | function stripHeaders(headers: Record<string, string>) { |
| 242 | const blacklistHeaders = [ |
| 243 | "connection", |
| 244 | "cf-ray", |
| 245 | "cf-connecting-ip", |
| 246 | "host", |
| 247 | "cf-ipcountry", |
| 248 | "content-length", |
| 249 | ]; |
| 250 | |
| 251 | return Object.fromEntries( |
| 252 | Object.entries(headers).filter(([key]) => !blacklistHeaders.includes(key.toLowerCase())) |
| 253 | ); |
| 254 | } |
| 255 | |
| 256 | function fetch(url: RequestInfo, init?: RequestInit) { |
| 257 | const fetchInit: RequestInit = { ...init }; |
no test coverage detected
searching dependent graphs…