lnbits / lnurlp

MIT License
9 stars 8 forks source link

checks if hostname is .onion and change scheme #11

Closed talvasconcelos closed 1 year ago

talvasconcelos commented 1 year ago

I think this is the "issue" Super Testnet raised on the Telegram channel!

Needs Tor testing, as I can't test it locally! @dni @motorina0 @callebtc ?

motorina0 commented 1 year ago

Needs Tor testing, as I can't test it locally! @dni @motorina0 @callebtc ?

callebtc commented 1 year ago

I don't understand what this PR does, maybe you can explain. User enters a wrong URL and this PR corrects it? Why does the user enter a wrong URL in the first place?

talvasconcelos commented 1 year ago

Needs Tor testing, as I can't test it locally! @dni @motorina0 @callebtc ?

  • can you please add testing steps

Spin lnbits behind Tor -> generate an lnurlp -> scan the QR to check if URL is https (which will fail) or http

talvasconcelos commented 1 year ago

I don't understand what this PR does, maybe you can explain. User enters a wrong URL and this PR corrects it? Why does the user enter a wrong URL in the first place?

SuperTestnet reported an issue on telegram group about the QR from LNURLp, if lnbits is behind Tor, has the URL with https scheme, instead of http (i think it's the way FastAPI's url_for works)! This PR just check, before creating the link/callback if the url is a Tor (.onion) URL and replace https with http

motorina0 commented 1 year ago

@dni did you managed to test this PR?