mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-10-05 12:28:22 +00:00
simplified key_expiry_time header logic
This commit is contained in:
+1
-1
@@ -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
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user