mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
http: fix regression of binary upgrade response body
See: https://github.com/nodejs/node/issues/24958 PR-URL: https://github.com/nodejs/node/pull/25037 Reviewed-By: Myles Borins <myles.borins@gmail.com>
This commit is contained in:
1 parent
e1fbc26c6a
commit
215ecfe4de
1 file changed
+3
-3
@@ -621,8 +621,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
|
||||
@@ -637,7 +635,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);
|
||||
|
||||
Reference in new issue
Block a user