X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;ds=sidebyside;f=sima%2Flib%2Fhttp.py;h=f9a08bed869e961292d6911d03b53a5639f6b0d4;hb=0374809fd2dd8e22c24efc0ce08df9ceefcf01b5;hp=10fae9c475204852b73eabe039447d4d5d4497e4;hpb=f3df46ac87d5f9d1824156d9fed605dd03f3ccde;p=mpd-sima.git diff --git a/sima/lib/http.py b/sima/lib/http.py index 10fae9c..f9a08be 100644 --- a/sima/lib/http.py +++ b/sima/lib/http.py @@ -190,12 +190,6 @@ class CacheController(object): # return the original handler return False - def add_headers(self, url): - resp = self.cache.get(url) - if resp and 'etag' in resp.headers: - return {'If-None-Match': resp.headers['etag']} - return {} - def cache_response(self, request, resp): """ Algorithm for caching requests. @@ -308,10 +302,6 @@ class HttpClient: resp = self.controller.update_cached_response(prepreq, resp) elif resp.status_code != 200: raise WSHTTPError('{0.status_code}: {0.reason}'.format(resp)) - ratelimit = resp.headers.get('x-ratelimit-remaining', None) - if ratelimit and self.stats: - minrl = min(int(ratelimit), self.stats.get('minrl')) - self.stats.update(minrl=minrl) self.controller.cache_response(resp.request, resp) return resp