fix: Back to using relative path

This commit is contained in:
Tom Moor
2026-05-16 21:08:03 -04:00
parent 879d2b8198
commit c1010fc410
+11
View File
@@ -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]).
*