Skip to content
This repository was archived by the owner on Oct 21, 2024. It is now read-only.

Commit d9d3f42

Browse files
committed
Add escaping for bad platform string.
From GitbookIO#138
1 parent d613496 commit d9d3f42

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/nuts.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,9 @@ Nuts.prototype.onUpdateRedirect = function (req, res, next) {
257257
if (!req.query.platform) throw new Error('Requires "platform" parameter');
258258

259259
return res.redirect(
260-
`${that.opts.routePrefix}update/${req.query.platform}/${req.query.version}`
260+
`${that.opts.routePrefix}update/${_.escape(req.query.platform)}/${
261+
req.query.version
262+
}`
261263
);
262264
})
263265
.fail(next);

0 commit comments

Comments
 (0)