Skip to content

Commit 8a3e0c0

Browse files
mcollinaMylesBorins
authored andcommitted
http: fix regression of binary upgrade response body
See: #24958 PR-URL: #25036 Reviewed-By: Myles Borins <myles.borins@gmail.com>
1 parent 92968b6 commit 8a3e0c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/node_http_parser.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -610,8 +610,6 @@ class Parser : public AsyncWrap {
610610
size_t nparsed =
611611
http_parser_execute(&parser_, &settings, data, len);
612612

613-
enum http_errno err = HTTP_PARSER_ERRNO(&parser_);
614-
615613
Save();
616614

617615
// Unassign the 'buffer_' variable
@@ -626,7 +624,9 @@ class Parser : public AsyncWrap {
626624
Local<Integer> nparsed_obj = Integer::New(env()->isolate(), nparsed);
627625
// If there was a parse error in one of the callbacks
628626
// TODO(bnoordhuis) What if there is an error on EOF?
629-
if ((!parser_.upgrade && nparsed != len) || err != HPE_OK) {
627+
if (!parser_.upgrade && nparsed != len) {
628+
enum http_errno err = HTTP_PARSER_ERRNO(&parser_);
629+
630630
Local<Value> e = Exception::Error(env()->parse_error_string());
631631
Local<Object> obj = e->ToObject(env()->isolate());
632632
obj->Set(env()->bytes_parsed_string(), nparsed_obj);

0 commit comments

Comments
 (0)