mirror of
https://github.com/makeplane/plane.git
synced 2026-04-27 03:21:45 -05:00
regression: fallback base url for redirection (#8075)
This commit is contained in:
committed by
GitHub
parent
8853637e98
commit
d05c222d0a
@@ -5,8 +5,10 @@
|
||||
*/
|
||||
export function ensureTrailingSlash(url: string): string {
|
||||
try {
|
||||
// Handle relative URLs by creating a URL object with a dummy base
|
||||
const urlObj = new URL(url, "http://dummy.com");
|
||||
const fallbackBaseUrl =
|
||||
typeof window !== "undefined" && window.location.origin ? window.location.origin : "http://dummy.com";
|
||||
// Handle relative URLs by creating a URL object with a fallback base URL
|
||||
const urlObj = new URL(url, fallbackBaseUrl);
|
||||
|
||||
// Don't modify root path
|
||||
if (urlObj.pathname === "/") {
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
*/
|
||||
export function ensureTrailingSlash(url: string): string {
|
||||
try {
|
||||
// Handle relative URLs by creating a URL object with a dummy base
|
||||
const urlObj = new URL(url, "http://dummy.com");
|
||||
const fallbackBaseUrl =
|
||||
typeof window !== "undefined" && window.location.origin ? window.location.origin : "http://dummy.com";
|
||||
// Handle relative URLs by creating a URL object with a fallback base URL
|
||||
const urlObj = new URL(url, fallbackBaseUrl);
|
||||
|
||||
// Don't modify root path
|
||||
if (urlObj.pathname === "/") {
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
*/
|
||||
export function ensureTrailingSlash(url: string): string {
|
||||
try {
|
||||
// Handle relative URLs by creating a URL object with a dummy base
|
||||
const urlObj = new URL(url, "http://dummy.com");
|
||||
const fallbackBaseUrl =
|
||||
typeof window !== "undefined" && window.location.origin ? window.location.origin : "http://dummy.com";
|
||||
// Handle relative URLs by creating a URL object with a fallback base URL
|
||||
const urlObj = new URL(url, fallbackBaseUrl);
|
||||
|
||||
// Don't modify root path
|
||||
if (urlObj.pathname === "/") {
|
||||
|
||||
Reference in New Issue
Block a user