From ca966942674c83715de15d2f7fb77163c2785162 Mon Sep 17 00:00:00 2001 From: Ben Schwarz Date: Fri, 10 Jun 2011 14:00:18 +1000 Subject: [PATCH] Handle application/json & text/json (Which large providers - AKA Google, Flickr and Yahoo LOVE to send on JSON bodies.) --- lib/faraday_stack.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/faraday_stack.rb b/lib/faraday_stack.rb index 5214eec..913142c 100644 --- a/lib/faraday_stack.rb +++ b/lib/faraday_stack.rb @@ -34,7 +34,7 @@ def self.build(url = nil, options = {}) yield builder if block_given? builder.use ResponseXML, :content_type => /[+\/]xml$/ builder.use ResponseHTML, :content_type => 'text/html' - builder.use ResponseJSON, :content_type => 'application/json' + builder.use ResponseJSON, :content_type => /(application|text)\/json/ builder.use FollowRedirects builder.response :raise_error builder.adapter Faraday.default_adapter