You can observe this with a very simple app:
var app = express();
app.get('/', function (req, res) {
console.log(req.originalUrl);
console.log(req.query);
res.send(req.query);
});
app.listen(7000);
If you go to http://localhost:7000/?thing=this+that
, express receives the plus sign and still has it in originalUrl
, but req.query
contains { thing: 'this that' }
.
This makes it so that if a float in the form of 1.7976931348623157e+308
is used in a query parameter, it cannot be parsed correctly in express.
Actually, scratch that, you can get the parse you desire with
qs
in our own parser function. The replacement is happening athttps://github.com/ljharb/qs/blob/037f3686e8f8eee456cf958c39ffd8a967d4ead5/lib/utils.js#L112
I hope that helps!