Skip to content

Commit 5e630d9

Browse files
committed
fix CJK characters cause a 301 redirect loop
For example, open the `http://localhost:3000/你好`, Google Chrome will receive an error: ERR_TOO_MANY_REDIRECTS
1 parent 713c89a commit 5e630d9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ app.use(async (req, res) => {
177177
}
178178

179179
const locationState = store.getState().router.location;
180-
if (req.originalUrl !== locationState.pathname + locationState.search) {
180+
if (decodeURIComponent(req.originalUrl) !== decodeURIComponent(locationState.pathname + locationState.search)) {
181181
return res.redirect(301, locationState.pathname);
182182
}
183183

0 commit comments

Comments
 (0)