Skip to content

Commit

Permalink
URI escape location arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
causal-agent committed Oct 7, 2013
1 parent 49dca77 commit e1647d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/wunderground.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def method_missing(method, *args)
ip_address = opts[:geo_ip] and args.push("autoip") if opts[:geo_ip]
timeout = opts[:timeout]
end
call(url <<'/q/'<< args.join('/') << ".json" << (ip_address ? "?geo_ip=#{ip_address}" : ''),timeout)
call(url <<'/q/'<< URI.escape(args.join('/')) << ".json" << (ip_address ? "?geo_ip=#{ip_address}" : ''),timeout)
end
class << self
Expand All @@ -89,4 +89,4 @@ def method_missing(sym, *args, &block)
def method_missing_match?(method)
method.to_s.end_with?("_for")
end
end
end

0 comments on commit e1647d7

Please sign in to comment.