mirror of
https://github.com/bumi/lntip
synced 2026-02-16 14:07:51 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ae9f643fbf | |||
| 5fd10bc647 | |||
| 5d2c9cd639 |
BIN
files/assets/lnme-icon-bnw.png
Normal file
BIN
files/assets/lnme-icon-bnw.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 397 KiB |
BIN
files/assets/lnme-icon-rect.png
Normal file
BIN
files/assets/lnme-icon-rect.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 760 KiB |
11
lnme.go
11
lnme.go
@@ -152,8 +152,13 @@ func main() {
|
||||
if !cfg.Bool("disable-ln-address") {
|
||||
lnurlHandler := func(c echo.Context) error {
|
||||
host := c.Request().Host
|
||||
if c.Request().Header.Get(echo.HeaderXForwardedFor) != "" {
|
||||
host = c.Request().Header.Get(echo.HeaderXForwardedFor)
|
||||
proto := c.Scheme()
|
||||
// TODO: support RFC7239 Forwarded header
|
||||
if c.Request().Header.Get("X-Forwarded-Host") != "" {
|
||||
host = c.Request().Header.Get("X-Forwarded-Host")
|
||||
}
|
||||
if c.Request().Header.Get("X-Forwarded-Proto") != "" {
|
||||
proto = c.Request().Header.Get("X-Forwarded-Proto")
|
||||
}
|
||||
name := c.Param("name")
|
||||
lightningAddress := name + "@" + host
|
||||
@@ -162,7 +167,7 @@ func main() {
|
||||
if amount := c.QueryParam("amount"); amount == "" {
|
||||
lnurlPayResponse1 := lnurl.LNURLPayResponse1{
|
||||
LNURLResponse: lnurl.LNURLResponse{Status: "OK"},
|
||||
Callback: fmt.Sprintf("%s://%s%s", c.Scheme(), host, c.Request().URL.Path),
|
||||
Callback: fmt.Sprintf("%s://%s%s", proto, host, c.Request().URL.Path),
|
||||
MinSendable: 1000,
|
||||
MaxSendable: 100000000,
|
||||
EncodedMetadata: lnurlMetadata,
|
||||
|
||||
Reference in New Issue
Block a user