20688: urldecode the redirect path before storing it
authorPeter Amstutz <peter.amstutz@curii.com>
Tue, 18 Jul 2023 17:46:50 +0000 (13:46 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Tue, 18 Jul 2023 17:46:50 +0000 (13:46 -0400)
Necessary because nginx url rewrites will turn the "+" into a "%2B",
so we need to turn it back.  After more than an hour of messing with
it, it's easier to fix workbench 2 than to fix nginx.

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

src/common/redirect-to.ts

index 73c9484323a76169dc43f60bd210f16dfcf2e679..e71ebde7f15e35d757a2e542c5c0419591fe8fd9 100644 (file)
@@ -39,7 +39,7 @@ export const storeRedirects = () => {
     const redirectStoreKey = redirectKey === REDIRECT_TO_KEY ? REDIRECT_TO_PREVIEW_KEY : redirectKey;
 
     if (localStorage && redirectKey && redirectStoreKey) {
-        localStorage.setItem(redirectStoreKey, href.split(`${redirectKey}=`)[1]);
+        localStorage.setItem(redirectStoreKey, decodeURIComponent(href.split(`${redirectKey}=`)[1]));
     }
 };