Skip to content

Commit

Permalink
hawk 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Eran Hammer committed Mar 2, 2013
1 parent 049cefa commit e0e0fb4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
9 changes: 1 addition & 8 deletions index.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -983,14 +983,7 @@ Request.prototype.aws = function (opts, now) {
}

Request.prototype.hawk = function (opts) {
var creds = {key:opts.key, id:opts.id, algorithm:opts.algorithm}
delete opts.key
delete opts.id
delete opts.algorithm

var port = this.uri.port || (this.uri.protocol === 'https:' ? 443 : 80)

this.headers.Authorization = hawk.getAuthorizationHeader(creds, this.method, this.uri.path, this.uri.hostname, parseInt(port), opts)
this.headers.Authorization = hawk.getAuthorizationHeader(this.uri, this.method, opts)
}

Request.prototype.oauth = function (_oauth) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"dependencies": {
"form-data": "~0.0.3",
"mime": "~1.2.7",
"hawk": "~0.8.1",
"hawk": "~0.9.0",
"node-uuid": "~1.4.0",
"cookie-jar": "~0.2.0",
"aws-sign": "~0.2.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/test-hawk.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var server = createServer(function (req, resp) {

server.listen(8080, function () {
var creds = {key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn', algorithm: 'sha256', id:'dh37fgj492je'}
request('http://localhost:8080', {hawk:creds}, function (e, r, b) {
request('http://localhost:8080', {hawk:{credentials:creds}}, function (e, r, b) {
assert.equal(200, r.statusCode)
assert.equal(b, 'Hello Steve')
server.close()
Expand Down

0 comments on commit e0e0fb4

Please sign in to comment.