diff --git a/lib/omniauth/strategies/facebook.rb b/lib/omniauth/strategies/facebook.rb index de2f291..a188fe4 100644 --- a/lib/omniauth/strategies/facebook.rb +++ b/lib/omniauth/strategies/facebook.rb @@ -219,14 +219,14 @@ module OmniAuth def image_url uid, options uri_class = options[:secure_image_url] ? URI::HTTPS : URI::HTTP - url = uri_class.build({host: 'graph.facebook.com', path: "/#{uid}/picture"}) + url = uri_class.build({:host => 'graph.facebook.com', :path => "/#{uid}/picture"}) query = if options[:image_size].is_a?(String) - { type: options[:image_size] } + { :type => options[:image_size] } elsif options[:image_size].is_a?(Hash) options[:image_size] end - url.query = URI.encode_www_form(query) if query + url.query = Rack::Utils.build_query(query) if query url.to_s end diff --git a/test/test.rb b/test/test.rb index b604ded..424238b 100644 --- a/test/test.rb +++ b/test/test.rb @@ -118,7 +118,7 @@ class InfoTest < StrategyTestCase end test 'returns the image with width and height specified in the `image_size` option' do - @options = { :image_size => { width: 123, height: 987 } } + @options = { :image_size => { :width => 123, :height => 987 } } raw_info = { 'name' => 'Fred Smith', 'id' => '321' } strategy.stubs(:raw_info).returns(raw_info) assert_equal 'http://graph.facebook.com/321/picture?width=123&height=987', strategy.info['image']