tag check
This commit is contained in:
@@ -488,7 +488,8 @@ async def api_lnurlscan(code: str, wallet: WalletTypeInfo = Depends(get_key_type
|
|||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
tag = data["tag"]
|
tag = data.get("tag")
|
||||||
|
params.update(**data)
|
||||||
if tag == "channelRequest":
|
if tag == "channelRequest":
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=HTTPStatus.BAD_REQUEST,
|
status_code=HTTPStatus.BAD_REQUEST,
|
||||||
@@ -498,10 +499,7 @@ async def api_lnurlscan(code: str, wallet: WalletTypeInfo = Depends(get_key_type
|
|||||||
"message": "unsupported",
|
"message": "unsupported",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
elif tag == "withdrawRequest":
|
||||||
params.update(**data)
|
|
||||||
|
|
||||||
if tag == "withdrawRequest":
|
|
||||||
params.update(kind="withdraw")
|
params.update(kind="withdraw")
|
||||||
params.update(fixed=data["minWithdrawable"] == data["maxWithdrawable"])
|
params.update(fixed=data["minWithdrawable"] == data["maxWithdrawable"])
|
||||||
|
|
||||||
@@ -519,8 +517,7 @@ async def api_lnurlscan(code: str, wallet: WalletTypeInfo = Depends(get_key_type
|
|||||||
query=urlencode(qs, doseq=True)
|
query=urlencode(qs, doseq=True)
|
||||||
)
|
)
|
||||||
params.update(callback=urlunparse(parsed_callback))
|
params.update(callback=urlunparse(parsed_callback))
|
||||||
|
elif tag == "payRequest":
|
||||||
if tag == "payRequest":
|
|
||||||
params.update(kind="pay")
|
params.update(kind="pay")
|
||||||
params.update(fixed=data["minSendable"] == data["maxSendable"])
|
params.update(fixed=data["minSendable"] == data["maxSendable"])
|
||||||
|
|
||||||
@@ -538,8 +535,8 @@ async def api_lnurlscan(code: str, wallet: WalletTypeInfo = Depends(get_key_type
|
|||||||
params.update(image=data_uri)
|
params.update(image=data_uri)
|
||||||
if k == "text/email" or k == "text/identifier":
|
if k == "text/email" or k == "text/identifier":
|
||||||
params.update(targetUser=v)
|
params.update(targetUser=v)
|
||||||
|
|
||||||
params.update(commentAllowed=data.get("commentAllowed", 0))
|
params.update(commentAllowed=data.get("commentAllowed", 0))
|
||||||
|
|
||||||
except KeyError as exc:
|
except KeyError as exc:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=HTTPStatus.SERVICE_UNAVAILABLE,
|
status_code=HTTPStatus.SERVICE_UNAVAILABLE,
|
||||||
|
|||||||
Reference in New Issue
Block a user