actually verify the nip05 and strikethrough it if invalid.

This commit is contained in:
fiatjaf
2024-11-27 10:36:10 -03:00
committed by dtonon
parent 07f891f0f8
commit 83805748a5
2 changed files with 6 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import (
"html/template"
"net/http"
"strings"
"time"
)
func renderProfile(ctx context.Context, r *http.Request, w http.ResponseWriter, code string) {
@@ -117,6 +118,10 @@ func renderProfile(ctx context.Context, r *http.Request, w http.ResponseWriter,
),
}
// give this global context a timeout because it may used inside the template to validate the nip05 address
ctx, cancel := context.WithTimeout(ctx, time.Second*3)
defer cancel()
if isEmbed {
err = embeddedProfileTemplate(params).Render(ctx, w)
} else {