Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Encoding request urls

  • Loading branch information...
commit 6f963e4a3ee1d7208a395e6f80b3272fb3e20c79 1 parent 73cad8e
Carlos Kozuszko authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  lib/r_weather.rb
4  lib/r_weather.rb
@@ -20,7 +20,7 @@ def self.key; @@key; end
20 20
   def self.key=(value); @@key = value; end
21 21
 
22 22
   def self.search(where)
23  
-    if data = get_and_parse(sprintf(SEARCH_URL, where))
  23
+    if data = get_and_parse(sprintf(SEARCH_URL, URI.encode(where)))
24 24
       data['loc'].map{|loc| RWeatherLocation.new(loc['type'], loc['id'], loc['content'])}
25 25
     end
26 26
   end
@@ -30,7 +30,7 @@ def self.current_conditions(location_id, unit = DEFAULT_UNIT)
30 30
     url = sprintf(LOCAL_URL, location_id, partner_id, key)
31 31
     url << "&cc=true"
32 32
     url << "&unit=#{unit}" if VALID_UNITS.include?(unit)
33  
-    if data = get_and_parse(url)
  33
+    if data = get_and_parse(URI.encode(url))
34 34
       RWeatherCurrentCondition.parse(data)
35 35
     end
36 36
   end

0 notes on commit 6f963e4

Please sign in to comment.
Something went wrong with that request. Please try again.