Permalink
Browse files

Proxy authentication header part added.

  • Loading branch information...
1 parent 81e27b6 commit b756e2b3a1258e46f1d54f1e76bce07121c5befd @gevorg gevorg committed Jan 23, 2013
Showing with 19 additions and 3 deletions.
  1. +9 −1 lib/auth/basic.js
  2. +9 −1 lib/auth/digest.js
  3. +1 −1 package.json
View
@@ -61,7 +61,15 @@ Basic.prototype.isAuthenticated = function(request) {
var authenticated = undefined;
// If header exists.
- if("authorization" in request.headers) {
+ var authHeader = null;
+
+ if ("authorization" in request.headers) {
+ authHeader = request.headers["authorization"];
+ } else if ("proxy-authorization" in request.headers) {
+ authHeader = request.headers["proxy-authorization"];
+ }
+
+ if (authHeader) {
var header = request.headers.authorization;
var clientUserString = header.split(" ")[1];
View
@@ -80,7 +80,15 @@ Digest.prototype.isAuthenticated = function(request, callback) {
var authenticated = undefined;
// If header exists.
- if("authorization" in request.headers) {
+ var authHeader = null;
+
+ if ("authorization" in request.headers) {
+ authHeader = request.headers["authorization"];
+ } else if ("proxy-authorization" in request.headers) {
+ authHeader = request.headers["proxy-authorization"];
+ }
+
+ if (authHeader) {
var header = request.headers.authorization;
var co = this.parseAuthHeader(header);
View
@@ -1,7 +1,7 @@
{
"name": "http-auth",
"description": "Node.js package for HTTP basic and digest access authentication.",
- "version": "1.2.5",
+ "version": "1.2.6",
"author": "Gevorg Harutyunyan (http://github.com/gevorg)",
"maintainers": [
{

0 comments on commit b756e2b

Please sign in to comment.