mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
fix: Back to using relative path
This commit is contained in:
@@ -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]).
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user