elastic / elastic-transport-js

Transport classes and utilities shared among Node.js Elastic client libraries
Apache License 2.0
5 stars 25 forks source link

fix: only pass documented options to 'http.request()' #62

Closed trentm closed 1 year ago

trentm commented 1 year ago

https://nodejs.org/api/http.html#httprequestoptions-callback Passing in the extra fields -- in particular 'href' and 'origin' -- makes node v20 believe the options object is a URL instance. For a brief period, this broke with some node v20 nightlies.

Fixes: #59

trentm commented 1 year ago

Thanks!

Super weird that v20 mistook that for a URL.

Here is the code change in node that caused it, along with a comment giving reasoning: https://github.com/nodejs/node/commit/027841c964998c87ff684cae5d3da647df8f37d9#diff-26e6b1e2a90040b1ce20e7f305b2ff3140b483f863ee2573b4c6af9b696ad31eR537-R548