Created
July 23, 2010 14:54
-
-
Save alanho/487540 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#place this inside config/initializers/ | |
require 'oauth/request_proxy/typhoeus_request' | |
module OAuthFix | |
def self.included(base) | |
base.send :include, InstanceMethods | |
base.module_eval %q{ | |
alias_method :old_post_parameters, :post_parameters | |
alias_method :post_parameters, :fixed_post_parameters | |
} | |
end | |
module InstanceMethods | |
def fixed_post_parameters | |
if(method == 'POST') | |
request.params || {} | |
else | |
{} | |
end | |
end | |
end | |
end | |
OAuth::RequestProxy::Typhoeus::Request.send :include, OAuthFix |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment