* added test for empty post data, for issue #847 * black * fixed the failing testcase * Update lnbits/decorators.py Co-authored-by: calle <93376500+callebtc@users.noreply.github.com> Co-authored-by: dni <dni.khr@gmail.com> Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>
This commit is contained in:
@@ -199,7 +199,13 @@ async def require_invoice_key(
|
||||
api_key_header: str = Security(api_key_header), # type: ignore
|
||||
api_key_query: str = Security(api_key_query), # type: ignore
|
||||
):
|
||||
token = api_key_header if api_key_header else api_key_query
|
||||
token = api_key_header or api_key_query
|
||||
|
||||
if token is None:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
detail="Invoice (or Admin) key required.",
|
||||
)
|
||||
|
||||
wallet = await get_key_type(r, token)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user