chai-http
chai-http copied to clipboard
refactor(request): abstract https server into a tls server for protocol checks
The TLS.Server
instance is common for both the https
library and the http2
library,
according to the NodeJS documentation. Since it is a common ancestor, we should check for
this instance instead of the specific https
flavour.
On a similar note, the net.Server
instance is common for both http
and http2
too,
though no changes are required to ensure they're cast to the same.
See the following links:
- https://nodejs.org/api/http.html#class-httpserver
- https://nodejs.org/api/http2.html#class-http2server
- https://nodejs.org/api/https.html#class-httpsserver
- https://nodejs.org/api/http2.html#class-http2secureserver