mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-05 16:58:59 +00:00
Allowing oauth users to not bother having a user agent.
This commit is contained in:
parent
5b543377a8
commit
4cb75f782d
2 changed files with 3 additions and 3 deletions
|
@ -183,12 +183,14 @@ BANNED_USER_AGENTS = (
|
|||
'feed reader-background',
|
||||
'missing',
|
||||
)
|
||||
|
||||
class UserAgentBanMiddleware:
|
||||
def process_request(self, request):
|
||||
user_agent = request.environ.get('HTTP_USER_AGENT', 'missing').lower()
|
||||
|
||||
if 'profile' in request.path: return
|
||||
if 'haproxy' in request.path: return
|
||||
if 'account' in request.path: return
|
||||
if getattr(settings, 'TEST_DEBUG'): return
|
||||
|
||||
if any(ua in user_agent for ua in BANNED_USER_AGENTS):
|
||||
|
@ -200,4 +202,3 @@ class UserAgentBanMiddleware:
|
|||
|
||||
return HttpResponse(json.encode(data), status=403, mimetype='text/json')
|
||||
|
||||
|
||||
|
|
|
@ -128,7 +128,6 @@ OAUTH2_PROVIDER = {
|
|||
'write': 'Create new saved stories, shared stories, and subscriptions.',
|
||||
'ifttt': 'Pair your NewsBlur account with other IFTTT channels.',
|
||||
},
|
||||
|
||||
'CLIENT_ID_GENERATOR_CLASS': 'oauth2_provider.generators.ClientIdGenerator',
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue