Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 2a191ea051b20a492a3325413dcdca11b593ba50 1 parent d07cbf2
@twoism authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.