We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5958654 commit 778b6f3Copy full SHA for 778b6f3
1 file changed
app.js
@@ -172,6 +172,17 @@ passport.deserializeUser(function (id, done) {
172
});
173
174
175
+// check uri is valid before going further
176
+app.use(function(req, res, next) {
177
+ try {
178
+ decodeURIComponent(req.path);
179
+ } catch (err) {
180
+ logger.error(err);
181
+ return response.errorBadRequest(res);
182
+ }
183
+ next();
184
+});
185
+
186
// redirect url with trailing slashes
187
app.use(function(req, res, next) {
188
if ("GET" == req.method && req.path.substr(-1) == '/' && req.path.length > 1) {
0 commit comments