mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-18 14:54:24 +01:00
actually verify the nip05 and strikethrough it if invalid.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user