Permalink
Browse files

check headers for Retry-After in absence of retry-after

  • Loading branch information...
wtn authored and sferik committed Mar 7, 2011
1 parent 3adcc15 commit 924253214efcedfeb80b4c6fe57dcbb2a7470177
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/twitter/error.rb
View
@@ -29,7 +29,7 @@ def initialize(message, http_headers)
#
# @see http://dev.twitter.com/pages/rate-limiting
def retry_after
- @http_headers.values_at('retry-after', 'Retry-After').first.to_i
+ @http_headers.values_at('retry-after', 'Retry-After').detect {|value| value }.to_i
end
end

0 comments on commit 9242532

Please sign in to comment.