Skip to content

Commit

Permalink
Closes #722
Browse files Browse the repository at this point in the history
  • Loading branch information
Eran Hammer committed Mar 28, 2013
1 parent 6b612fd commit 53d29b1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lib/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ internals.Proxy.prototype.handler = function () {
var options = {
uri: uri,
method: request.method,
headers: {}
headers: {},
jar: false
};

if (self.settings.passThrough) { // Never set with cache
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "hapi",
"description": "HTTP Server framework",
"homepage": "http://hapijs.com",
"version": "0.15.7",
"version": "0.15.8",
"author": {
"name": "Eran Hammer",
"email": "eran@hueniverse.com",
Expand Down
21 changes: 17 additions & 4 deletions test/integration/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,16 @@ describe('Proxy', function () {

var profile = function () {

this.reply({
if (this.state.test) {
return this.reply('error');
}

this.reply.payload({
'id': 'fa0dbda9b1b',
'name': 'John Doe'
});
})
.state('test', '123')
.send();
};

var activeItem = function () {
Expand Down Expand Up @@ -173,7 +179,8 @@ describe('Proxy', function () {
method: options.method,
url: server.settings.uri + options.path,
form: options.form,
headers: options.headers
headers: options.headers,
jar: false
}, next);
}

Expand All @@ -183,7 +190,13 @@ describe('Proxy', function () {

expect(rawRes.statusCode).to.equal(200);
expect(rawRes.body).to.contain('John Doe');
done();

makeRequest({ path: '/profile' }, function (rawRes) {

expect(rawRes.statusCode).to.equal(200);
expect(rawRes.body).to.contain('John Doe');
done();
});
});
});

Expand Down

0 comments on commit 53d29b1

Please sign in to comment.