having built an express REST api got a problem when one of the clients is calling one service with encoding the & to &
I do not know how to modify all the request object's properties before is routed.
I tried in a middleware to modify the req.query object but the req.query keys itself are "corrupted":
ex: 'amp;paramname' because express it is splitting it at & from &
{ p1: 'v1',
'amp;p2': 'v2',
'amp;p3': ... }var express = require('express'); // call express
var app = module.exports = express();
var bodyParser = require('body-parser');
var validator = require('express-validator');
var cors = require('cors');
app.use( bodyParser.json() );
app.use( bodyParser.urlencoded({ extended: true }) );
app.use( validator() );
app.use( cors() );
// START THE SERVER
// =============================================================================
if(!module.parent){ app.listen(config.port); }
// REGISTER OUR ROUTES -------------------------------
app.use('/rs', require('./routes/rsRoutes'));That is not possible since I have no responsibility on that application, belongs to another company and so on...I know is crap they encode the url so or something but...
Yes but the problem is that they were using an old api that somehow worked with this type of call and my new api has new REST calls but should work also with the old ws type of calls, so when I did it I had example calls and didn't see they also can use some with & instead of &.Old api was in php and they didn't have this problem, it seems.To tell them now they have to change the way they did some calls is a bit hard because of political shit.