Closed SimonWoolf closed 5 years ago
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
lib/request.js | 2 | 81.41% | ||
<!-- | Total: | 2 | --> |
Totals | |
---|---|
Change from base Build 48: | -0.3% |
Covered Lines: | 324 |
Relevant Lines: | 383 |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
lib/request.js | 2 | 81.41% | ||
<!-- | Total: | 2 | --> |
Totals | |
---|---|
Change from base Build 48: | -0.3% |
Covered Lines: | 324 |
Relevant Lines: | 383 |
Currently, when testing to see whether an https endpoint supports http2, the library makes a tls connection with
ALPNProtocols: ['h2']
only.The problem is that some tls endpoints that don't support http2 really don't like that; they just abruptly terminate the connection.
This change results in it using
ALPNProtocols: ['h2', 'http/1.1']
when testing for http2 support. AFAICT this doesn't break anything - it's not like the code is taking a successful connection as an indication of http2, it's correctly checkingsocket.alpnProtocol
. If the server does support http2, the result of the negotiation will be h2.To reproduce, do the following:
require('http2-client').get('https://echo.ably.io/', res => console.log("done", res.httpVersion))
Before this change, that results in:
After this change, it results in: