menorki commited on
Commit
37cb335
·
1 Parent(s): f63ed17
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -91,7 +91,7 @@ proxies = {}
91
  # Custom decorator to check for the access key
92
  def require_access_key(func):
93
  @wraps(func)
94
- async def wrapper(*args, **kwargs):
95
  request = kwargs.get('request') # Get the 'request' object from the endpoint's kwargs
96
  access_key = request.query_params.get('AK')
97
 
@@ -99,7 +99,7 @@ def require_access_key(func):
99
  if access_key != AK:
100
  return PlainTextResponse("ERROR: Unauthorized call" , status_code=401)
101
 
102
- return await func(*args, **kwargs) # Call the actual endpoint function
103
  return wrapper
104
 
105
  @app.get('/')
 
91
  # Custom decorator to check for the access key
92
  def require_access_key(func):
93
  @wraps(func)
94
+ def wrapper(*args, **kwargs):
95
  request = kwargs.get('request') # Get the 'request' object from the endpoint's kwargs
96
  access_key = request.query_params.get('AK')
97
 
 
99
  if access_key != AK:
100
  return PlainTextResponse("ERROR: Unauthorized call" , status_code=401)
101
 
102
+ return func(*args, **kwargs) # Call the actual endpoint function
103
  return wrapper
104
 
105
  @app.get('/')