From 0102aefd96d621e9ed32dfdadb9a22cb7c592eca Mon Sep 17 00:00:00 2001 From: GitHappens2Me Date: Wed, 28 May 2025 18:58:40 +0200 Subject: [PATCH] simplified key_expiry_time header logic --- .gitignore | 2 +- router/proxy.py | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index b7f6d083..2a5e2170 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,5 @@ wallet.sqlite3 .notes .*keys.db .*wallet.sqlite3 -.models.json +.*models.json compose.override.yml \ No newline at end of file diff --git a/router/proxy.py b/router/proxy.py index 84ae24b9..9b06125e 100644 --- a/router/proxy.py +++ b/router/proxy.py @@ -37,16 +37,14 @@ async def proxy( content="Invalid Key-Expiry-Time: must be a valid Unix timestamp", status_code=400, ) - else: - key_expiry_time = None - - if(key_expiry_time and not refund_address): - return Response( + if(not refund_address): + return Response( content=f"Error: Refund-LNURL header required when using Key-Expiry-Time", status_code=400, ) + else: + key_expiry_time = None - key = await validate_bearer_key(bearer_key, session, refund_address, key_expiry_time) # Pre-validate JSON for requests that require it