return http error UNAUTHORIZED instead of BAD_REQUEST if key is missing (#869)

* return http error UNAUTHORIZED instead of BAD_REQUEST if key is missing

* fix regtest (#867)

Co-authored-by: dni <dni.khr@gmail.com>

* return http error UNAUTHORIZED instead of BAD_REQUEST if key is missing

Co-authored-by: dni  <office@dnilabs.com>
Co-authored-by: dni <dni.khr@gmail.com>
This commit is contained in:
calle 2022-08-13 14:41:44 +02:00 committed by GitHub
parent 32a09f7359
commit 28661903b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,7 +270,7 @@ async def api_payments_create(
return await api_payments_create_invoice(invoiceData, wallet.wallet)
else:
raise HTTPException(
status_code=HTTPStatus.BAD_REQUEST,
status_code=HTTPStatus.UNAUTHORIZED,
detail="Invoice (or Admin) key required.",
)