This commit is contained in:
codl 2017-09-24 23:49:08 +02:00
parent 4f1fb8f262
commit 1b07bf1020
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
2 changed files with 3 additions and 4 deletions

View File

@ -5,7 +5,7 @@ from flask import make_response, abort
import secrets
import hmac
import base64
import pickle
import pickle # nosec
import re
@ -109,7 +109,7 @@ class ImgProxyCache(object):
body = self.redis.get(self.key('body', url))
try:
headers = pickle.loads(headers)
headers = pickle.loads(headers) # nosec
except Exception as e:
self.redis.delete(self.key('headers', url))
headers = None

View File

@ -4,7 +4,6 @@ from mastodon.Mastodon import MastodonAPIError, MastodonNetworkError,\
from model import MastodonApp, Account, OAuthToken, Post
from requests import head
from app import db, sentry
from math import inf
from libforget.exceptions import TemporaryError
from functools import lru_cache
@ -84,7 +83,7 @@ def get_api_for_acc(account):
# doesnt error even if the token is revoked lol
# https://github.com/tootsuite/mastodon/issues/4637
# so we have to do this:
tl = api.timeline()
api.timeline()
return api
except MastodonAPIError as e:
if 'token' in str(e):