lnurlp: fix success_url checking.

This commit is contained in:
fiatjaf 2021-06-04 00:29:55 -03:00
parent d9b37c077d
commit 05139b3305

View File

@ -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)