Handle API 1.1 rate limit header names
authorHayes Davis <hayes@unionmetrics.com>
Sun, 31 Mar 2013 21:33:24 +0000 (14:33 -0700)
committerHayes Davis <hayes@unionmetrics.com>
Sun, 31 Mar 2013 21:55:17 +0000 (14:55 -0700)
lib/grackle/client.rb

index 2b5b7de2874ea85f733c41d85568b3e74cb48cdb..cff958b470ed2da07086f476d5f50279b037699d 100644 (file)
@@ -95,10 +95,15 @@ module Grackle
     DEFAULT_API_HOST = :v1_1
 
     # Contains the response headers from twitter
-    DEFAULT_RESPONSE_HEADERS =[
+    DEFAULT_RESPONSE_HEADERS = [
+      # These are API 1 rate limit header names
       'x-ratelimit-limit',
       'x-ratelimit-remaining',
-      'x-ratelimit-reset'
+      'x-ratelimit-reset',
+      # These are API 1.1 rate limit header names
+      'x-rate-limit-limit',
+      'x-rate-limit-remaining',
+      'x-rate-limit-reset'
     ]
 
     #Basic OAuth information needed to communicate with Twitter