Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 924253214efcedfeb80b4c6fe57dcbb2a7470177 1 parent 3adcc15
authored sferik committed

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  lib/twitter/error.rb
2  lib/twitter/error.rb
@@ -29,7 +29,7 @@ def initialize(message, http_headers)
29 29
     #
30 30
     # @see http://dev.twitter.com/pages/rate-limiting
31 31
     def retry_after
32  
-      @http_headers.values_at('retry-after', 'Retry-After').first.to_i
  32
+      @http_headers.values_at('retry-after', 'Retry-After').detect {|value| value }.to_i
33 33
     end
34 34
   end
35 35
 

0 notes on commit 9242532

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