an upstream system is making a get req to out system with utf-8 encoded even the ? is encoded.
the sample url is –>
http://localhost:3000/hello%3FfirstName%3DPaperTest%26lastName%3DAddressMerge%26typeOfIdProof%3DEmirates+ID%26idProofNumber%3D123–2%26nationality%3DARE%26sourceSystem%3DDealer+App%26dateOfBirth%3D2001-09-29%26userId%3D111%26transactionId%3D9162655831313265133%26segmentName%3DN%2FA%26productType%3DTshirt
my express app could not get the query string from the above so i created a middle ware
const app = express()
const qrystr = require("querystring")
app.set("query string","extended")
app.use((req,res,next)=>{
let val = req.query.
console.log(req.query)
let qry = qrystr.parse(val)
req.query = qry
next()
})
app.get("/hello*",(req,res)=>{
let val = {...req['query']}
// console.log(val)
console.log(req.params)
res.send("OK")
})
but in req.query i am getting
{
‘0’: ‘?firstName=PaperTest&lastName=AddressMerge&typeOfIdProof=Emirates+ID&idProofNumber=123-123-1111-2&nationality=ARE&sourceSystem=Dealer+App&dateOfBirth=2001-09-29&userId=111&transactionId=9162655831313265133&segmentName=N/A&productType=tshirt’
}
could any one could suggest how to parse the above url / req properly so i could get the value like we used to get in req.query