in make-fetch-happen we construct a request object and then pass it as the only parameter to fetch, like
const req = new fetch.Request(uri, opts)
return fetch(req)
the current behavior of this module will extract some properties from the request object, but not all, which causes things like the rejectUnauthorized, ca, cert, key, etc options to be dropped when the actual request is sent.
in addition, the current behavior is such that if input was an object, but that object doesn't contain an href property, we would drop the entire object in favor of an empty one.
the changes here will allow the above usage to work as intended, as well as being more intuitive when passing input as an object.
in make-fetch-happen we construct a request object and then pass it as the only parameter to fetch, like
the current behavior of this module will extract some properties from the request object, but not all, which causes things like the
rejectUnauthorized
,ca
,cert
,key
, etc options to be dropped when the actual request is sent.in addition, the current behavior is such that if
input
was an object, but that object doesn't contain anhref
property, we would drop the entire object in favor of an empty one.the changes here will allow the above usage to work as intended, as well as being more intuitive when passing input as an object.
References
Related to https://github.com/npm/cli/issues/1700