File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,10 @@ module.exports = function(options){
88 var error = errors . parse ( err ) ;
99 req . error = JSON . parse ( JSON . stringify ( error ) ) ; //for logging of internal messages by logger
1010 console . error ( req . error ) ;
11- res . statusCode = error . http ;
12- delete error . http ; //do not show http code to users (it's send in header)
11+ if ( ! req . param ( "callback" ) ) {
12+ res . statusCode = error . http ; //only non-jsonp should get http status codes other than 200
13+ delete error . http ; //do not show http code to users (it's send in header)
14+ }
1315 delete error . internal ; //do not show internal messages to users
1416 res . json ( error ) ;
1517 }
Original file line number Diff line number Diff line change 11{
22 "author" :" Allan Ebdrup" ,
33 "name" :" nodeerrors" ,
4- "version" :" 1.0.2 " ,
4+ "version" :" 1.0.3 " ,
55 "repository" :{
66 "type" :" git" ,
77 "url" :" https://github.com/Muscula/nodeerrors"
You can’t perform that action at this time.
0 commit comments