Socket
Socket
Sign inDemoInstall

errorhandler

Package Overview
Dependencies
Maintainers
6
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

errorhandler - npm Package Compare versions

Comparing version 1.3.6 to 1.4.0

14

HISTORY.md

@@ -0,1 +1,15 @@

1.4.0 / 2015-06-10
==================
* Add charset to the `Content-Type` header
* Support `statusCode` property on `Error` objects
* deps: accepts@~1.2.9
- deps: mime-types@~2.1.1
- deps: negotiator@0.5.3
- perf: avoid argument reassignment & argument slice
- perf: avoid negotiator recursive construction
- perf: enable strict mode
- perf: remove unnecessary bitwise operator
* deps: escape-html@1.0.2
1.3.6 / 2015-05-14

@@ -2,0 +16,0 @@ ==================

11

index.js

@@ -10,2 +10,4 @@ /*!

'use strict'
/**

@@ -83,2 +85,7 @@ * Module dependencies.

return function errorHandler(err, req, res, next){
// respect err.statusCode
if (err.statusCode) {
res.statusCode = err.statusCode
}
// respect err.status

@@ -143,7 +150,7 @@ if (err.status) {

var json = JSON.stringify({ error: error });
res.setHeader('Content-Type', 'application/json');
res.setHeader('Content-Type', 'application/json; charset=utf-8')
res.end(json);
// plain text
} else {
res.setHeader('Content-Type', 'text/plain');
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
res.end(str)

@@ -150,0 +157,0 @@ }

10

package.json
{
"name": "errorhandler",
"description": "Development-only error handler middleware",
"version": "1.3.6",
"version": "1.4.0",
"contributors": [

@@ -12,9 +12,9 @@ "Douglas Christopher Wilson <doug@somethingdoug.com>",

"dependencies": {
"accepts": "~1.2.6",
"escape-html": "1.0.1"
"accepts": "~1.2.9",
"escape-html": "1.0.2"
},
"devDependencies": {
"after": "0.8.1",
"istanbul": "0.3.9",
"mocha": "2.2.4",
"istanbul": "0.3.15",
"mocha": "2.2.5",
"supertest": "1.0.1"

@@ -21,0 +21,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc