Skip to content
Snippets Groups Projects
Commit 2706a99f authored by Alex Reisner's avatar Alex Reisner
Browse files

Document changes to oauth_util.rb.

parent c4af3491
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,13 @@ ...@@ -3,6 +3,13 @@
# Source: http://gist.github.com/383159 # Source: http://gist.github.com/383159
# License: http://gist.github.com/375593 # License: http://gist.github.com/375593
# Usage: see example.rb below # Usage: see example.rb below
#
# NOTE: This file has been modified from the original Gist:
#
# 1. Fix to prevent param-array conversion, as mentioned in Gist comment.
# 2. Query string escaping has been changed. See:
# https://github.com/alexreisner/geocoder/pull/360
#
require 'uri' require 'uri'
require 'cgi' require 'cgi'
...@@ -74,7 +81,6 @@ class OauthUtil ...@@ -74,7 +81,6 @@ class OauthUtil
# if url has query, merge key/values into params obj overwriting defaults # if url has query, merge key/values into params obj overwriting defaults
if parsed_url.query if parsed_url.query
#@params.merge! CGI.parse( parsed_url.query )
CGI.parse( parsed_url.query ).each do |k,v| CGI.parse( parsed_url.query ).each do |k,v|
if v.is_a?(Array) && v.count == 1 if v.is_a?(Array) && v.count == 1
@params[k] = v.first @params[k] = v.first
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment