Compare commits

...
Author SHA1 Message Date
9qeklajc 8c9ede2272 split all spaces 2026-02-25 17:57:17 +01:00
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -29,7 +29,8 @@ def check_token_balance(headers: dict, body: dict, max_cost_for_model: int) -> N
},
)
elif auth := headers.get("authorization", None):
cashu_token = auth.split(" ")[1] if len(auth.split(" ")) > 1 else ""
parts = auth.split()
cashu_token = parts[1] if len(parts) > 1 else ""
logger.debug(
"Using Authorization header token",
extra={
+2 -1
View File
@@ -390,7 +390,8 @@ async def get_bearer_token_key(
headers: dict, path: str, session: AsyncSession, auth: str, min_cost: int = 0
) -> ApiKey:
"""Handle bearer token authentication proxy requests."""
bearer_key = auth.replace("Bearer ", "") if auth.startswith("Bearer ") else ""
parts = auth.split()
bearer_key = parts[1] if len(parts) > 1 and parts[0].lower() == "bearer" else ""
refund_address = headers.get("Refund-LNURL", None)
key_expiry_time = headers.get("Key-Expiry-Time", None)