Permalink
Browse files

0.12.2

  • Loading branch information...
1 parent a8afabe commit e79353814fb15ea50e0f4b92edb931b9ead6f7c8 @hueniverse committed Apr 12, 2013
Showing with 17 additions and 1 deletion.
  1. +7 −0 lib/utils.js
  2. +1 −1 package.json
  3. +9 −0 test/utils.js
View
@@ -165,3 +165,10 @@ exports.parseAuthorizationHeader = function (header, keys) {
return attributes;
};
+
+
+exports.unauthorized = function (message) {
+
+ return Boom.unauthorized(message, 'Hawk');
+};
+
View
@@ -1,7 +1,7 @@
{
"name": "hawk",
"description": "HTTP Hawk Authentication Scheme",
- "version": "0.12.1",
+ "version": "0.12.2",
"author": "Eran Hammer <eran@hueniverse.com> (http://hueniverse.com)",
"contributors": [],
"repository": "git://github.com/hueniverse/hawk",
View
@@ -67,6 +67,15 @@ describe('Hawk', function () {
done();
});
});
+
+ describe('#unauthorized', function () {
+
+ it('returns a hawk 401', function (done) {
+
+ expect(Hawk.utils.unauthorized('kaboom').response.headers['WWW-Authenticate']).to.equal('Hawk error="kaboom"');
+ done();
+ });
+ });
});
});

0 comments on commit e793538

Please sign in to comment.