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 &

Call ex.: https://localhost:8080/rs?p1=v1&p2=v2&

then req.query is:

{ p1: 'v1',
  'amp;p2': 'v2',
  'amp;p3': ... }


app.js:

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'));

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/08c926d9-cc4d-4715-8734-9fb8bcae5102%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to