Skip to content
Browse files

Don't attempt to parse bodies that only contain spaces.

  Rails 2.x head responses return a single space as
  the body. This is due to a Safari bug where the headers
  are not passed if the content length is zero.
  • Loading branch information...
1 parent d07cbf2 commit 2a191ea051b20a492a3325413dcdca11b593ba50 @twoism committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/twitter/response/parse_json.rb
View
2 lib/twitter/response/parse_json.rb
@@ -7,7 +7,7 @@ class ParseJson < Faraday::Response::Middleware
def parse(body)
case body
- when '', nil
+ when /\A^\s*$\z/, nil
nil
when 'true'
true

0 comments on commit 2a191ea

Please sign in to comment.
Something went wrong with that request. Please try again.