-
-
Notifications
You must be signed in to change notification settings - Fork 959
Always set options.url
when possible
#1753
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
Comments
It also seems that the
|
I wasn't able to reproduce the unhandled promise rejection, but I managed to set |
But then Got would not know where to throw the error at. Is it a Promise? Is it a Stream? |
If you can reproduce the unhandled promise rejection, please open another issue and I'll fix it. |
main
branch)options.url
when possible
I tried to reproduce the unhandled rejection again and was not able to. I guess your latest changes must have fixed it. 👍 |
Describe the bug
Actual behavior
When you pass an invalid option to
got
, the options do not get merged correctly or something else happens and the handlers are invoked without actually having access to the provided options. It's most likely caused by the newly added strict validation of options.If you run the code example below, you'll see that
console.log(options.foo)
printsundefined
and theNo URL
error will be thrown.Expected behavior
I would expect an
Unexpected option: foo
error to be thrown. Not the handlers to be called with missing options. If I remove the handlers, the code behaves as expected. It also works fine in Got 11, albeit without theUnexpected option
error.Code to reproduce
Checklist
The text was updated successfully, but these errors were encountered: