| 5 | import { createOvClient } from './client' |
| 6 | |
| 7 | function readRequestHeader(config: AxiosRequestConfig, name: string): string { |
| 8 | const headers = config.headers as |
| 9 | | { get?: (headerName: string) => unknown } |
| 10 | | Record<string, unknown> |
| 11 | | undefined |
| 12 | if (!headers) { |
| 13 | return '' |
| 14 | } |
| 15 | if ('get' in headers && typeof headers.get === 'function') { |
| 16 | const value = headers.get(name) |
| 17 | return typeof value === 'string' ? value : '' |
| 18 | } |
| 19 | const value = headers[name] ?? headers[name.toLowerCase()] |
| 20 | return typeof value === 'string' ? value : '' |
| 21 | } |
| 22 | |
| 23 | function createRecordingClient() { |
| 24 | const requests: AxiosRequestConfig[] = [] |