Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing a URL object overrides options parameter #1

Closed
vegardbb opened this issue Mar 8, 2022 · 1 comment
Closed

Passing a URL object overrides options parameter #1

vegardbb opened this issue Mar 8, 2022 · 1 comment
Assignees

Comments

@vegardbb
Copy link
Owner

vegardbb commented Mar 8, 2022

hrap/index.js

Lines 35 to 40 in 9a4890e

if (typeof url === 'object') {
if (isStringHttps(url?.protocol)) {
return asyncHttps(null, url)
}
return asyncHttp(null, url)
}

It might be desirable to pass a set of options along with a URL object, provided the properties in the URL object takes presence.

@vegardbb
Copy link
Owner Author

From Node.js API documentation on http.request

If both url and options [parameters] are specified, the objects are merged, with the options properties taking precedence.

I'll prioritize for v2.2 to emulate the underlying API the library is wrapping.

@vegardbb vegardbb self-assigned this Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant