Closed PenguinScola closed 1 year ago
I'm having the same question as @PenguinScola.
Any solution to this issue, I'm also having this problem :(
Lastly I did this to resolve on my server.js file.
const server = express();
server.use(function(req, res, next) {
try {
decodeURIComponent(req.originalUrl);
} catch (err) {
res.redirect(301, "/");
next(err);
}
});
// Do other stuffs
server.use(handler).listen(3000);
I am developing tag tracking system on NextJS and my application URL need to receive parameter as tag name that contains % and # characters. For example, "C#", "100%" etc.
So its URL will look like below.
For "C#", I have found that query value from getInitialProps function will be "C" only (# character is cut) and for "100%", I have found that next-routes return error as below. URI malformed has occurred on decodeURIComponent function because of % character.
If I need to handle both of characters, could you please suggest how can I handle them by using next-routes?