refac
This commit is contained in:
1 parent
258454276e
commit
7e79f8d1c6
1 file changed
+3
-1
@@ -1329,7 +1329,9 @@ class APIKeyRestrictionMiddleware(BaseHTTPMiddleware):
|
|||||||
token = None
|
token = None
|
||||||
|
|
||||||
if auth_header:
|
if auth_header:
|
||||||
scheme, token = auth_header.split(" ")
|
parts = auth_header.split(" ", 1)
|
||||||
|
if len(parts) == 2:
|
||||||
|
token = parts[1]
|
||||||
|
|
||||||
# Only apply restrictions if an sk- API key is used
|
# Only apply restrictions if an sk- API key is used
|
||||||
if token and token.startswith("sk-"):
|
if token and token.startswith("sk-"):
|
||||||
|
|||||||
Reference in new issue
Block a user