( location: string, baseUrl: string | URL, )
| 82 | * Used when manually following redirects to prevent redirect-to-internal bypasses. |
| 83 | */ |
| 84 | export async function validateRedirectTarget( |
| 85 | location: string, |
| 86 | baseUrl: string | URL, |
| 87 | ): Promise<URL> { |
| 88 | const redirectUrl = new URL(location, baseUrl); |
| 89 | await validateFetchUrl(redirectUrl); |
| 90 | return redirectUrl; |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * Reconstruct a URL from its validated components. |
no test coverage detected