(name: string)
| 52 | try { |
| 53 | const headers = event?.node?.req?.headers ?? event?.headers; |
| 54 | const get = (name: string): string | undefined => { |
| 55 | if (!headers) return undefined; |
| 56 | if (typeof headers.get === "function") { |
| 57 | return headers.get(name) ?? undefined; |
| 58 | } |
| 59 | const map = headers as Record<string, string | undefined>; |
| 60 | return map[name] ?? map[String(name).toLowerCase()]; |
| 61 | }; |
| 62 | const proto = get("x-forwarded-proto") || "http"; |
| 63 | const host = get("host") || `localhost:${process.env.PORT || 3000}`; |
| 64 | return withConfiguredAppBasePath(`${proto}://${host}`); |
no test coverage detected