toland / patron

Ruby HTTP client based on libcurl
http://toland.github.com/patron/
MIT License
541 stars 73 forks source link

Fix base url concatenation if base_url is empty #94

Closed msievers closed 9 years ago

msievers commented 9 years ago

If no base_url is given d34837c0d1bac643b05e9f2bc8618006c2b0f932 produces incorrect URIs.

Example

# base_url is "" because of nil.to_s
URI.parse(File.join("", "http://localhost")) # => #<URI::Generic /http://localhost>

Easiest way to fix this is to add a conditional for the case base_url.empty?.

toland commented 9 years ago

Good catch. Thanks.