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
|
||||
// We have to redirect here because if we redirect on the server, it might get encoded again
|
||||
// in the browser causing a redirect loop
|
||||
const decodedPathname = decodeURIComponent(pathname);
|
||||
if (decodedPathname !== pathname) {
|
||||
return <Redirect to={decodedPathname} />;
|
||||
const decodedUrl = decodeURIComponent(pathname + search);
|
||||
if (decodedUrl !== pathname + search) {
|
||||
return <Redirect to={decodedUrl} />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in a new issue