(req: http.IncomingMessage)
| 296 | } |
| 297 | |
| 298 | function resolveHttpRequestBaseUrl(req: http.IncomingMessage): string { |
| 299 | const host = typeof req.headers.host === 'string' ? req.headers.host : ''; |
| 300 | if (!host) throw new AppError('INVALID_ARGS', 'Missing host header'); |
| 301 | const forwardedProto = req.headers['x-forwarded-proto']; |
| 302 | const proto = Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto; |
| 303 | return `${proto || 'http'}://${host}`; |
| 304 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…