simplified key_expiry_time header logic

This commit is contained in:
GitHappens2Me
2025-05-28 18:58:40 +02:00
parent ecea6f3acb
commit 0102aefd96
2 changed files with 5 additions and 7 deletions
+1 -1
View File
@@ -7,5 +7,5 @@ wallet.sqlite3
.notes .notes
.*keys.db .*keys.db
.*wallet.sqlite3 .*wallet.sqlite3
.models.json .*models.json
compose.override.yml compose.override.yml
+4 -6
View File
@@ -37,16 +37,14 @@ async def proxy(
content="Invalid Key-Expiry-Time: must be a valid Unix timestamp", content="Invalid Key-Expiry-Time: must be a valid Unix timestamp",
status_code=400, status_code=400,
) )
else: if(not refund_address):
key_expiry_time = None return Response(
if(key_expiry_time and not refund_address):
return Response(
content=f"Error: Refund-LNURL header required when using Key-Expiry-Time", content=f"Error: Refund-LNURL header required when using Key-Expiry-Time",
status_code=400, status_code=400,
) )
else:
key_expiry_time = None
key = await validate_bearer_key(bearer_key, session, refund_address, key_expiry_time) key = await validate_bearer_key(bearer_key, session, refund_address, key_expiry_time)
# Pre-validate JSON for requests that require it # Pre-validate JSON for requests that require it