(self: ServerRequest.HttpServerRequest)
| 362 | |
| 363 | /** @internal */ |
| 364 | export const toURL = (self: ServerRequest.HttpServerRequest): Option.Option<URL> => { |
| 365 | const host = self.headers.host ?? "localhost" |
| 366 | const protocol = self.headers["x-forwarded-proto"] === "https" ? "https" : "http" |
| 367 | try { |
| 368 | return Option.some(new URL(self.url, `${protocol}://${host}`)) |
| 369 | } catch { |
| 370 | return Option.none() |
| 371 | } |
| 372 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…