backport: http: fix connection upgrade checks
Checklist
-
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
- http
Description of change
This commit fixes connection upgrade checks, specifically when headers are passed as an array instead of a plain object to http.request()
.
This is a backport of https://github.com/nodejs/node/pull/8238.