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
Add enableUnixSockets
option
#2062
Add enableUnixSockets
option
#2062
Conversation
Thanks for working on this. You also need to update the documentation. https://github.com/sindresorhus/got/blob/main/documentation/tips.md#unix-domain-sockets can be moved to the options docs for this option. |
documentation/2-options.md
Outdated
await got('http://unix:/var/run/docker.sock:/containers/json'); | ||
|
||
// Or without protocol (HTTP by default) | ||
await got('unix:/var/run/docker.sock:/containers/json'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing the actual option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we actually include the option in all examples? This way we'd encourage users to explicitly enable/disable UNIX sockets, which will ease transitioning to a new major release.
@sindresorhus Do you think rerunning the test will work? Don’t think the extra if-statement made us exceed the limit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Don't worry about that. We'll fix that in the |
const gotUnixSocketsDisabled = got.extend({enableUnixSockets: false}); | ||
|
||
t.false(gotUnixSocketsDisabled.defaults.options.enableUnixSockets); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is quite useless. You can just call got('unix:', {enableUnixSockets: false})
which does the same.
Thanks @TommyDew42 |
What is the PR for?
For issue #2046, we add an option to control if unix domain socket is supported:
How is the PR tested?
Unit tests.
Checklist