Skip to content

Commit

Permalink
Fix hapijs#949, move to cryptiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Eran Hammer committed Jul 3, 2013
1 parent 632aea7 commit 35bffb8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 9 additions & 0 deletions examples/stream.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Load modules

var Hapi = require('../lib');
var Request = require('request');


// Declare internals
Expand All @@ -14,10 +15,18 @@ internals.echo = function () {
};


internals.request = function () {

var reqStream = Request('http://google.com');
reqStream.once('response', this.reply);
};


internals.main = function () {

var server = new Hapi.Server(8000);
server.route({ method: 'POST', path: '/', config: { handler: internals.echo, payload: 'stream' } });
server.route({ method: 'GET', path: '/request', handler: internals.request });
server.start();
};

Expand Down
4 changes: 1 addition & 3 deletions lib/auth/hawk.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ exports = module.exports = internals.Scheme = function (server, options) {
internals.Scheme.prototype.authenticate = function (request, callback) {

Hawk.server.authenticate(request.raw.req, this.settings.getCredentialsFunc, this.settings.hawk, function (err, credentials, artifacts) {
if (artifacts && !artifacts.hash) {
artifacts.hash = '';
}

return callback(err, credentials, { artifacts: artifacts });
});
};
Expand Down

0 comments on commit 35bffb8

Please sign in to comment.