Skip to content

Commit

Permalink
Make sure URI doesn't think any of the URL is a path
Browse files Browse the repository at this point in the history
  • Loading branch information
maccman committed Apr 21, 2010
1 parent 2ad6147 commit 2d79304
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/nestful/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ def initialize(url, options = {})
end

def [](suburl)
self.class.new(URI.join(url, suburl).to_s)
base = url
base += "/" unless base =~ /\/$/
self.class.new(URI.join(base, suburl).to_s)
end

def get(options = {})
Expand Down

0 comments on commit 2d79304

Please sign in to comment.