fix: latest fastapi (#23)
Some checks failed
/ release (push) Has been cancelled
/ pullrequest (push) Has been cancelled

str(url) had to be casted earlier
This commit is contained in:
dni ⚡ 2023-09-29 07:22:45 +02:00 committed by GitHub
commit 31264e1fe4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,13 +56,13 @@ class PayLink(BaseModel):
return cls(**data) return cls(**data)
def lnurl(self, req: Request) -> str: def lnurl(self, req: Request) -> str:
url = req.url_for("lnurlp.api_lnurl_response", link_id=self.id) url = str(req.url_for("lnurlp.api_lnurl_response", link_id=self.id))
# Check if url is .onion and change to http # Check if url is .onion and change to http
if urlparse(url).netloc.endswith(".onion"): if urlparse(url).netloc.endswith(".onion"):
# change url string scheme to http # change url string scheme to http
url = url.replace("https://", "http://") url = url.replace("https://", "http://")
return lnurl_encode(str(url)) return lnurl_encode(url)
def success_action(self, payment_hash: str) -> Optional[Dict]: def success_action(self, payment_hash: str) -> Optional[Dict]:
if self.success_url: if self.success_url: