lib/twitter_auth/dispatcher/shared.rb in twitter-auth-0.1.11 vs lib/twitter_auth/dispatcher/shared.rb in twitter-auth-0.1.12
- old
+ new
@@ -1,7 +1,13 @@
module TwitterAuth
module Dispatcher
module Shared
+ def append_extension_to(path)
+ path, query_string = *(path.split("?"))
+ path << '.json' unless path.match(/\.(:?xml|json)\z/i)
+ "#{path}#{"?#{query_string}" if query_string}"
+ end
+
def handle_response(response)
case response
when Net::HTTPOK
begin
JSON.parse(response.body)