Permalink
Browse files

http: fix regression of binary upgrade response body

See: #24958

PR-URL: #25036
Reviewed-By: Myles Borins <myles.borins@gmail.com>
  • Loading branch information...
mcollina authored and MylesBorins committed Dec 14, 2018
1 parent 92968b6 commit 8a3e0c069747cb6a7e1889de92304856224fee72
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/node_http_parser.cc
@@ -610,8 +610,6 @@ class Parser : public AsyncWrap {
size_t nparsed =
http_parser_execute(&parser_, &settings, data, len);

enum http_errno err = HTTP_PARSER_ERRNO(&parser_);

Save();

// Unassign the 'buffer_' variable
@@ -626,7 +624,9 @@ class Parser : public AsyncWrap {
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());
obj->Set(env()->bytes_parsed_string(), nparsed_obj);

0 comments on commit 8a3e0c0

Please sign in to comment.