fix: normalize url (#76)
This commit is contained in:
parent
1d66d2f536
commit
218df89948
4 changed files with 871 additions and 666 deletions
|
|
@ -2,6 +2,7 @@ import json
|
|||
from typing import Optional
|
||||
|
||||
from fastapi import Query, Request
|
||||
from lnbits.helpers import normalize_path
|
||||
from lnurl import encode as lnurl_encode
|
||||
from lnurl.types import LnurlPayMetadata
|
||||
from pydantic import BaseModel
|
||||
|
|
@ -61,6 +62,7 @@ class PayLink(BaseModel):
|
|||
|
||||
def lnurl(self, req: Request) -> str:
|
||||
url = req.url_for("lnurlp.api_lnurl_response", link_id=self.id)
|
||||
url = url.replace(path=normalize_path(url.path))
|
||||
url_str = str(url)
|
||||
if url.netloc.endswith(".onion"):
|
||||
# change url string scheme to http
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue