Skip to content

Commit

Permalink
If the client sends a Expect: 100-continue header, wait to send data …
Browse files Browse the repository at this point in the history
…until we get the continue event
  • Loading branch information
emostar committed Oct 25, 2011
1 parent b5e3cb0 commit 3f13a95
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/expresso
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,13 @@ assert.response = function(server, req, res, msg) {
}, requestTimeout);
}

if (data) request.write(data);
if (req.headers.hasOwnProperty('Expect') && req.headers['Expect'] === '100-continue') {
request.on('continue', function() {
if (req.data) request.write(req.data);
});
} else {
if (req.data) request.write(req.data);
}

request.on('response', function(response) {
response.body = '';
Expand Down

0 comments on commit 3f13a95

Please sign in to comment.