keep search params when decoding url on frontend
This commit is contained in:
parent
27397285bc
commit
1e2714723f
1 changed files with 3 additions and 3 deletions
|
@ -131,9 +131,9 @@ function AppRouter(props: Props) {
|
||||||
// react-router doesn't decode pathanmes before doing the route matching check
|
// react-router doesn't decode pathanmes before doing the route matching check
|
||||||
// We have to redirect here because if we redirect on the server, it might get encoded again
|
// We have to redirect here because if we redirect on the server, it might get encoded again
|
||||||
// in the browser causing a redirect loop
|
// in the browser causing a redirect loop
|
||||||
const decodedPathname = decodeURIComponent(pathname);
|
const decodedUrl = decodeURIComponent(pathname + search);
|
||||||
if (decodedPathname !== pathname) {
|
if (decodedUrl !== pathname + search) {
|
||||||
return <Redirect to={decodedPathname} />;
|
return <Redirect to={decodedUrl} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in a new issue