(actual: string, expected: string)
| 30 | }; |
| 31 | |
| 32 | export const safeEqual = (actual: string, expected: string): boolean => { |
| 33 | const actualBytes = Buffer.from(actual); |
| 34 | const expectedBytes = Buffer.from(expected); |
| 35 | return actualBytes.length === expectedBytes.length && timingSafeEqual(actualBytes, expectedBytes); |
| 36 | }; |
| 37 | |
| 38 | const hostnameFromOrigin = (origin: string): string | null => { |
| 39 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: parsing an untrusted Origin header that may be malformed |
no test coverage detected