Skip to content

Commit

Permalink
Handle paths with leading slashes, and without.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdunphy committed Dec 9, 2009
1 parent 2abcf5b commit 2b67f35
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions print_json_response
Expand Up @@ -19,9 +19,8 @@ end

def process_url(url)
if url !~ /\Ahttp/
p = url.split('/').compact
p.unshift(DEFAULT_HOST)
url = p.join('/')
url = '/' + url unless url.start_with?('/')
url = DEFAULT_HOST + url
end

puts "Retrieving #{url}:"
Expand Down

0 comments on commit 2b67f35

Please sign in to comment.