From c1010fc410b9d396f1e31f3e02cb13474ebcb7d0 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 16 May 2026 21:08:03 -0400 Subject: [PATCH] fix: Back to using relative path --- app/utils/urls.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/utils/urls.ts b/app/utils/urls.ts index 6aed3f9ee3..7e7c0439ed 100644 --- a/app/utils/urls.ts +++ b/app/utils/urls.ts @@ -75,6 +75,17 @@ export function redirectTo(url: string) { window.location.href = url; } +/** + * Returns the relative path from a URL + * + * @param urlString The URL as a string + * @returns The relative path with query string and hash. + */ +export function toRelative(urlString: string) { + const url = new URL(urlString); + return `${url.pathname}${url.search}${url.hash}`; +} + /** * Check if a URI is a loopback address (localhost, 127.0.0.1, or [::1]). *