From 36c89b7a54b007676155186da4f6d1c48d4ef8d1 Mon Sep 17 00:00:00 2001 From: Robin Bron Date: Wed, 7 Jun 2017 15:07:06 +0200 Subject: [PATCH] Always pass request to 404 handler --- lib/router.js | 2 +- src/router.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/router.js b/lib/router.js index d8f8e30..9369d9c 100644 --- a/lib/router.js +++ b/lib/router.js @@ -791,7 +791,7 @@ }); return res.end(new Buffer(unescape(escaped_pixel_gif), 'binary')); } else { - return dispatch._404(null, res, pathname); + return dispatch._404(req, res, pathname); } } }); diff --git a/src/router.coffee b/src/router.coffee index a8b7d14..1e87bd2 100644 --- a/src/router.coffee +++ b/src/router.coffee @@ -647,7 +647,7 @@ Router = (options = {}) -> res.writeHead 200, {'Content-Type': mime_types[path_tools.extname('pixel.gif')] or 'image/gif'} return res.end new Buffer(unescape(escaped_pixel_gif), 'binary') else - dispatch._404 null, res, pathname + dispatch._404 req, res, pathname # CGI support (improved on 2012-09-07, further fixes on 2013-08-03)