chai-http icon indicating copy to clipboard operation
chai-http copied to clipboard

refactor(request): abstract https server into a tls server for protocol checks

Open J4Numbers opened this issue 1 year ago • 3 comments

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

J4Numbers avatar Nov 14 '23 17:11 J4Numbers