Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed bug where NotAuthorized error returned 403 instead of 401

  • Loading branch information...
commit 869d72f609d44c6b77e5a10e0d4efc76c5ecd17e 1 parent 9356bb8
@coen-hyde coen-hyde authored
Showing with 7 additions and 7 deletions.
  1. +1 −1  lib/journey/errors.js
  2. +6 −6 test/journey-test.js
View
2  lib/journey/errors.js
@@ -30,7 +30,7 @@ this.NotImplemented = function (msg) {
this.body = { error: msg };
};
this.NotAuthorized = function (msg) {
- this.status = 403;
+ this.status = 401;
this.headers = {};
this.body = { error: msg || 'Not Authorized' };
};
View
12 test/journey-test.js
@@ -383,8 +383,8 @@ vows.describe('Journey').addBatch({
topic: function () {
return get('/this_is/secure');
},
- "returns a 403": function (res) {
- assert.equal(res.status, 403);
+ "returns a 401": function (res) {
+ assert.equal(res.status, 401);
},
"returns a body with 'Not Authorized'": function (res) {
assert.equal(res.body.error, 'Not Authorized');
@@ -410,8 +410,8 @@ vows.describe('Journey').addBatch({
topic: function () {
return get('/this_is/still_secure');
},
- "returns a 403": function (res) {
- assert.equal(res.status, 403);
+ "returns a 401": function (res) {
+ assert.equal(res.status, 401);
},
"returns a body with 'Not Authorized'": function (res) {
assert.equal(res.body.error, 'Not Authorized');
@@ -437,8 +437,8 @@ vows.describe('Journey').addBatch({
topic: function () {
return get('/scoped_auth/secure');
},
- "returns a 403": function (res) {
- assert.equal(res.status, 403);
+ "returns a 401": function (res) {
+ assert.equal(res.status, 401);
},
"returns a body with 'Not Authorized'": function (res) {
assert.equal(res.body.error, 'Not Authorized');
Please sign in to comment.
Something went wrong with that request. Please try again.