(headers: IncomingMessage['headers'])
| 56 | } |
| 57 | |
| 58 | function headersToObject(headers: IncomingMessage['headers']): Record<string, string> { |
| 59 | const out: Record<string, string> = {}; |
| 60 | for (const [key, value] of Object.entries(headers)) { |
| 61 | if (value === undefined) continue; |
| 62 | out[key] = Array.isArray(value) ? value.join(',') : value; |
| 63 | } |
| 64 | return out; |
| 65 | } |
| 66 | |
| 67 | export async function startCallbackServer(opts?: { host?: string }): Promise<CallbackServerHandle> { |
| 68 | const host = opts?.host ?? '127.0.0.1'; |
no test coverage detected