commit
f3e68e7fb4
|
@ -65,7 +65,7 @@ class ImgProxyCache(object):
|
|||
if(resp.status_code != 200):
|
||||
return
|
||||
|
||||
header_whitelist = [
|
||||
allowed_headers = [
|
||||
'content-type',
|
||||
'cache-control',
|
||||
'etag',
|
||||
|
@ -81,7 +81,7 @@ class ImgProxyCache(object):
|
|||
if match:
|
||||
expire = max(self.expire, int(match.group(1)))
|
||||
|
||||
for key in header_whitelist:
|
||||
for key in allowed_headers:
|
||||
if key in resp.headers:
|
||||
headers[key] = resp.headers[key]
|
||||
self.redis.set(self.key('headers', url), pickle.dumps(headers, -1),
|
||||
|
|
|
@ -195,11 +195,11 @@ def delete(post):
|
|||
raise TemporaryError(e)
|
||||
|
||||
|
||||
def suggested_instances(limit=5, min_popularity=5, blacklist=tuple()):
|
||||
def suggested_instances(limit=5, min_popularity=5, blocklist=tuple()):
|
||||
return tuple((ins.instance for ins in (
|
||||
MastodonInstance.query
|
||||
.filter(MastodonInstance.popularity > min_popularity)
|
||||
.filter(~MastodonInstance.instance.in_(blacklist))
|
||||
.filter(~MastodonInstance.instance.in_(blocklist))
|
||||
.order_by(db.desc(MastodonInstance.popularity),
|
||||
MastodonInstance.instance)
|
||||
.limit(limit).all())))
|
||||
|
|
Loading…
Reference in New Issue