http: do not emit `upgrade` on advertisement
authorFedor Indutny <fedor@indutny.com>
Thu, 17 Dec 2015 22:23:46 +0000 (17:23 -0500)
committerMyles Borins <mborins@us.ibm.com>
Wed, 2 Mar 2016 22:01:11 +0000 (14:01 -0800)
commitdef3bb2882962cce0afc545ddff5d671c396bfc3
tree948f7e72a8a6a280587087f482d4efbdeafe4c39
parentdf1fb155acaf7b5dbebfdc9434b9700bf1e20c4b
http: do not emit `upgrade` on advertisement

Do not emit `upgrade` if the server is just advertising its protocols
support as per RFC 7230 Section 6.7.

    A server MAY send an Upgrade header field in any other response
    to advertise that it implements support for upgrading to the
    listed protocols, in order of descending preference, when
    appropriate for a future request.

Fix: https://github.com/nodejs/node/issues/4334
PR-URL: https://github.com/nodejs/node/pull/4337
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
lib/_http_client.js
lib/_http_common.js
test/parallel/test-http-upgrade-advertise.js [new file with mode: 0644]
test/parallel/test-http-upgrade-agent.js
test/parallel/test-http-upgrade-client.js