Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
http: fix regression of binary upgrade response body
Fixes: #24958
  • Loading branch information
mcollina committed Dec 14, 2018
commit 2f62ca9002759b7e2d7234cb6eba2bf1fcbb7154
6 changes: 3 additions & 3 deletions src/node_http_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,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 @@ -615,7 +613,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