Update main.py
This commit is contained in:
parent
dd1f43a70e
commit
416b6d4a65
|
@ -77,6 +77,7 @@ def main():
|
||||||
self.proxy()
|
self.proxy()
|
||||||
|
|
||||||
def _validate_user_and_key(self):
|
def _validate_user_and_key(self):
|
||||||
|
try:
|
||||||
# Extract the bearer token from the headers
|
# Extract the bearer token from the headers
|
||||||
auth_header = self.headers.get('Authorization')
|
auth_header = self.headers.get('Authorization')
|
||||||
if not auth_header or not auth_header.startswith('Bearer '):
|
if not auth_header or not auth_header.startswith('Bearer '):
|
||||||
|
@ -91,7 +92,8 @@ def main():
|
||||||
else:
|
else:
|
||||||
self.user = "unknown"
|
self.user = "unknown"
|
||||||
return False
|
return False
|
||||||
|
except:
|
||||||
|
return False
|
||||||
def proxy(self):
|
def proxy(self):
|
||||||
if not self._validate_user_and_key():
|
if not self._validate_user_and_key():
|
||||||
ASCIIColors.red(f'User is not authorized')
|
ASCIIColors.red(f'User is not authorized')
|
||||||
|
|
Loading…
Reference in New Issue