Skip to content

Commit

Permalink
http: fix regression of binary upgrade response body
Browse files Browse the repository at this point in the history
PR-URL: #25039
Fixes: #24958
Reviewed-By: Myles Borins <myles.borins@gmail.com>
  • Loading branch information
mcollina authored and MylesBorins committed Dec 21, 2018
1 parent 844bd62 commit c5140f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/node_http_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,6 @@ class Parser : public AsyncWrap, public StreamListener {
size_t nparsed =
http_parser_execute(&parser_, &settings, data, len);

enum http_errno err = HTTP_PARSER_ERRNO(&parser_);

Save();

// Unassign the 'buffer_' variable
Expand All @@ -621,7 +619,9 @@ class Parser : public AsyncWrap, public StreamListener {
Local<Integer> nparsed_obj = Integer::New(env()->isolate(), nparsed);
// If there was a parse error in one of the callbacks
// TODO(bnoordhuis) What if there is an error on EOF?
if ((!parser_.upgrade && nparsed != len) || err != HPE_OK) {
if (!parser_.upgrade && nparsed != len) {
enum http_errno err = HTTP_PARSER_ERRNO(&parser_);

Local<Value> e = Exception::Error(env()->parse_error_string());
Local<Object> obj = e->ToObject(env()->isolate()->GetCurrentContext())
.ToLocalChecked();
Expand Down

0 comments on commit c5140f5

Please sign in to comment.