Skip to content

Commit

Permalink
- updated to use get method on Message object
Browse files Browse the repository at this point in the history
  • Loading branch information
james-baber committed Mar 2, 2023
1 parent 543b8be commit 8f483c3
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions send2ue/dependencies/rpc/base_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,12 @@ def is_authorized(self):
:returns: Whether the request is authorized.
:rtype: bool
"""
for key, value in self.headers.items():
# do not allow requests sent cross site
if key == 'Sec-Fetch-Site' and value == 'cross-site':
return False
# only allow requests from localhost
if key == 'Origin' and not value.startswith('localhost'):
return False
# do not allow requests sent cross site
if self.headers.get('Sec-Fetch-Site') == 'cross-site':
return False
# do not allow requests from another origin
if self.headers.get('Origin'):
return False
return True

def report_401(self):
Expand Down

0 comments on commit 8f483c3

Please sign in to comment.