diff --git a/client/src/utils/redirect.test.ts b/client/src/utils/redirect.test.ts index 4be3d59d7914..a3887f510a37 100644 --- a/client/src/utils/redirect.test.ts +++ b/client/src/utils/redirect.test.ts @@ -10,6 +10,10 @@ test("route prefix changes", async () => { expect(withPrefix("http://")).toEqual("http://"); expect(withPrefix("/")).toEqual("/prefix/"); expect(withPrefix("/home")).toEqual("/prefix/home"); + // keep protocols in query parameters intact + expect(withPrefix("/authz/cilogon/login?idphint=https://test.com")).toEqual( + "/prefix/authz/cilogon/login?idphint=https://test.com" + ); // ensure that it can only be called once expect(withPrefix(withPrefix("/home"))).toEqual("/prefix/prefix/home"); // This doesn't do what it looks like it should do? diff --git a/client/src/utils/redirect.ts b/client/src/utils/redirect.ts index 3b0743093007..756613723bf0 100644 --- a/client/src/utils/redirect.ts +++ b/client/src/utils/redirect.ts @@ -10,7 +10,7 @@ export function reloadPage() { window.location.reload(); } -const slashCleanup = /(\/)+/g; +const slashCleanup = /(?