You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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?
The text was updated successfully, but these errors were encountered:
Lastly I did this to resolve on my server.js file.
constserver=express();server.use(function(req,res,next){try{decodeURIComponent(req.originalUrl);}catch(err){res.redirect(301,"/");next(err);}});// Do other stuffsserver.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?
The text was updated successfully, but these errors were encountered: