(input: string)
| 14 | } |
| 15 | |
| 16 | function decodeCredential(input: string) { |
| 17 | return Effect.fromResult(Encoding.decodeBase64String(input)).pipe( |
| 18 | Effect.match({ |
| 19 | onFailure: emptyCredential, |
| 20 | onSuccess: (header) => { |
| 21 | const separator = header.indexOf(":") |
| 22 | if (separator === -1) return emptyCredential() |
| 23 | return { username: header.slice(0, separator), password: Redacted.make(header.slice(separator + 1)) } |
| 24 | }, |
| 25 | }), |
| 26 | ) |
| 27 | } |
| 28 | |
| 29 | function credentialFromRequest(request: HttpServerRequest.HttpServerRequest) { |
| 30 | const url = new URL(request.url, "http://localhost") |
no test coverage detected