Skip to content

Commit

Permalink
Remove meaningless encoding arg
Browse files Browse the repository at this point in the history
  • Loading branch information
Eran Hammer committed Aug 27, 2013
1 parent 86d9c46 commit 99549b3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/response/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ internals.File.prototype._prepare = function (request, callback) {
}
else {
var hash = Crypto.createHash('sha1');
self._preview.on('peek', function (chunk, encoding) {
self._preview.on('peek', function (chunk) {

hash.update(chunk);
});
Expand Down
2 changes: 1 addition & 1 deletion lib/response/generic.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,6 @@ Utils.inherits(internals.Peek, Stream.Writable);

internals.Peek.prototype._write = function (chunk, encoding, callback) {

this.emit('peek', chunk, encoding);
this.emit('peek', chunk);
callback();
};
10 changes: 3 additions & 7 deletions test/integration/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ describe('Auth', function () {
server.inject(request, function (res) {

expect(res.statusCode).to.equal(200);
expect(res.raw.res._trailer).to.contain('Hawk');
expect(res.headers['server-authorization']).to.contain('Hawk');

var options = {
payload: res.payload
Expand All @@ -530,11 +530,7 @@ describe('Auth', function () {
getCredentials('john', function (err, cred) {

var header = Hawk.server.header(cred, authHeader.artifacts, options);
var trailerAuth = res.raw.res._trailer.split(':')[1];
trailerAuth = trailerAuth.substr(1, trailerAuth.lastIndexOf('"'));

expect(res.headers.trailer).to.contain('Server-Authorization');
expect(header).to.equal(trailerAuth);
expect(header).to.equal(res.headers['server-authorization']);
done();
});
});
Expand All @@ -547,8 +543,8 @@ describe('Auth', function () {

server.inject(request, function (res) {

expect(res.headers['server-authorization']).to.contain('Hawk');
expect(res.statusCode).to.equal(200);
expect(res.headers['server-authorization']).to.contain('Hawk');

var options = {
payload: res.payload,
Expand Down

0 comments on commit 99549b3

Please sign in to comment.