connect-oauth
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -98,3 +98,9 @@ var sys = require('sys'), | ||
this.use('/', function(err, req, res, next) { | ||
self.handleError(err, req, res, next); | ||
if(err.statusCode !== 401) return next(err); | ||
res.writeHead(401, { | ||
'Content-Type': 'text/plain', | ||
'WWW-Authenticate': 'OAuth realm="'+self.realm+'"' | ||
}); | ||
res.end(err.message || err); | ||
}); | ||
@@ -177,14 +183,2 @@ } | ||
OAuth.prototype.handleError = function(err, req, res, next) { | ||
var headers = { | ||
'Content-Type': 'text/plain', | ||
}; | ||
if(err.statusCode == 401) | ||
headers['WWW-Authenticate'] = 'OAuth realm="'+this.realm+'"'; | ||
res.writeHead(err.statusCode || 500, headers); | ||
res.end(err.message || err); | ||
} | ||
module.exports.createProvider = function(options) { | ||
@@ -191,0 +185,0 @@ return new OAuth(options); |
@@ -5,3 +5,3 @@ { | ||
"description": "Connect framework middleware implementing an OAuth 1.0a provider", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "url": "" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
144326
4315