mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-10-05 20:28:23 +00:00
+4
-1
@@ -273,7 +273,8 @@ async def proxy(
|
|||||||
if request_body:
|
if request_body:
|
||||||
try:
|
try:
|
||||||
request_body_dict = json.loads(request_body)
|
request_body_dict = json.loads(request_body)
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError as e:
|
||||||
|
print(f"Error: failed to parse request body '{e}'")
|
||||||
return Response(
|
return Response(
|
||||||
content=json.dumps(
|
content=json.dumps(
|
||||||
{"error": {"type": "invalid_request_error", "code": "invalid_json"}}
|
{"error": {"type": "invalid_request_error", "code": "invalid_json"}}
|
||||||
@@ -355,11 +356,13 @@ async def get_bearer_token_key(
|
|||||||
try:
|
try:
|
||||||
key_expiry_time = int(key_expiry_time) # type: ignore
|
key_expiry_time = int(key_expiry_time) # type: ignore
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
print("Invalid Key-Expiry-Time: must be a valid Unix timestamp")
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=400,
|
status_code=400,
|
||||||
detail="Invalid Key-Expiry-Time: must be a valid Unix timestamp",
|
detail="Invalid Key-Expiry-Time: must be a valid Unix timestamp",
|
||||||
)
|
)
|
||||||
if not refund_address:
|
if not refund_address:
|
||||||
|
print("Error: Refund-LNURL header required when using Key-Expiry-Time")
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=400,
|
status_code=400,
|
||||||
detail="Error: Refund-LNURL header required when using Key-Expiry-Time",
|
detail="Error: Refund-LNURL header required when using Key-Expiry-Time",
|
||||||
|
|||||||
Reference in New Issue
Block a user