Sorry I wasn't clear enough.
If an url contains `/`(which is valid character in URI) in query string, this code failed.
```ruby
2.0.0-p353 :001 > URI.decode('http://example.com/path/to/foo.txt?bar=baz/fubar').gsub(/.*\/(.*?$)/, '\1').split('?').first
 => "fubar"
2.0.0-p353 :002 > URI.decode('http://example.com/path/to/foo.txt?bar=baz/fubar'.split('?').first).gsub(/.*\/(.*?$)/, '\1')
 => "foo.txt"
```
My AWS secret key contained `/`,  so it became a problem.
I'll split this change into separate commit.