httprb / http

HTTP (The Gem! a.k.a. http.rb) - a fast Ruby HTTP client with a chainable API, streaming support, and timeouts
MIT License
3k stars 321 forks source link

raise error when invalid hash is passed to timeout #752

Open stoivo opened 1 year ago

stoivo commented 1 year ago

Hi, love httprb.

I would like to suggest to add some validation of the arguments to timeout. I can see that there are already some but we managed to pass {timeout: 5} as the argument

This is the related code. https://github.com/httprb/http/blob/462d711040735be3661068e9e52eb14a4269f1f4/lib/http/chainable.rb#L93-L112

I can open a PR of you would want that?

tarcieri commented 1 year ago

Yes, open a PR with what you're proposing