From 05139b330586d6ebe1528bbb7852a31f1070fd46 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Fri, 4 Jun 2021 00:29:55 -0300 Subject: [PATCH] lnurlp: fix success_url checking. --- lnbits/extensions/lnurlp/views_api.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lnbits/extensions/lnurlp/views_api.py b/lnbits/extensions/lnurlp/views_api.py index cbe1bc4e..af670c83 100644 --- a/lnbits/extensions/lnurlp/views_api.py +++ b/lnbits/extensions/lnurlp/views_api.py @@ -87,9 +87,12 @@ async def api_link_create_or_update(link_id=None): round(g.data["min"]) != g.data["min"] or round(g.data["max"]) != g.data["max"] ): return jsonify({"message": "Must use full satoshis."}), HTTPStatus.BAD_REQUEST - - if g.data["success_url"][:8] != "https://": - return jsonify({"message": "Success URL must be secure https://..."}), HTTPStatus.BAD_REQUEST + + if "success_url" in g.data and g.data["success_url"][:8] != "https://": + return ( + jsonify({"message": "Success URL must be secure https://..."}), + HTTPStatus.BAD_REQUEST, + ) if link_id: link = await get_pay_link(link_id)