Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

empty 404 to avoid error

  • Loading branch information...
commit 6ef79517703bf857534dfcf58cf9df185700a15f 1 parent 1e18663
@mountain authored
Showing with 10 additions and 6 deletions.
  1. +10 −6 vendor/node-router.js
View
16 vendor/node-router.js
@@ -31,12 +31,16 @@ var url_parse = require("url").parse;
// Used as a simple, convient 404 handler.
function notFound(req, res, message) {
- message = (message || "Not Found\n") + "";
- res.writeHead(404, {
- "Content-Type": "text/plain",
- "Content-Length": message.length
- });
- res.write(message);
+ try {
+ message = (message || "Not Found\n") + "";
+ res.writeHead(404, {
+ "Content-Type": "text/plain",
+ "Content-Length": message.length
+ });
+ res.write(message);
+ } catch (e) {
+ res.writeHead(404, {});
+ }
res.end();
}
Please sign in to comment.
Something went wrong with that request. Please try again.