lib/google_apis.rb in google-apis-0.1.7 vs lib/google_apis.rb in google-apis-0.2.0
- old
+ new
@@ -1,6 +1,7 @@
require "google/api_client"
+require "googleauth"
require "google_apis/core_ext"
require "google_apis/connection"
require "google_apis/api"
require "google_apis/version"
@@ -22,6 +23,13 @@
@connection
end
end
+# Use httpclient to avoid broken pipe errors with large uploads
Faraday.default_adapter = :httpclient
+
+# Only add the following statement if using Faraday >= 0.9.2
+# Override gzip middleware with no-op for httpclient
+if (Faraday::VERSION.split(".").collect(&:to_i) <=> [0, 9, 2]) > -1
+ Faraday::Response.register_middleware :gzip => Faraday::Response::Middleware
+end