Spaces:
Running
Running
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 |
-
|
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
|
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('/')
|