diff --git a/matrix/matrix.go b/matrix/matrix.go index cfb927b..18aec9d 100644 --- a/matrix/matrix.go +++ b/matrix/matrix.go @@ -29,7 +29,7 @@ type matrixClientWellKnown struct { func MatrixServer(w http.ResponseWriter, req *http.Request) { l := logger.Get() // uses an environment variable for now - wellKnownAddr := config.GetConfig().MatrixWellKnownAddress + wellKnownAddr := fmt.Sprintf("%s:8448", config.GetConfig().MatrixWellKnownAddress) if wellKnownAddr == "" { w.WriteHeader(http.StatusNotFound) l.Debug().Str("path", "matrix/server").Msg("matrix well known address unset") diff --git a/nostr/nostr.go b/nostr/nostr.go index aa82b7d..cebbc8c 100644 --- a/nostr/nostr.go +++ b/nostr/nostr.go @@ -46,9 +46,10 @@ func RequestNostrAddr(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, "html/nostr_form.html") case "POST": r.ParseForm() + name := strings.ToLower(r.FormValue("Name")) redisCli := redis.NostrRedisConn.Client // check if the user already exists - rKey := getRkey("verified", r.FormValue("Name"), getHostname(r.Host)) + rKey := getRkey("verified", name, getHostname(r.Host)) exists := redisCli.Exists(ctx, rKey) if exists.Val() == 1 { w.WriteHeader(http.StatusConflict) @@ -57,7 +58,7 @@ func RequestNostrAddr(w http.ResponseWriter, r *http.Request) { }) return } - rKey = getRkey("requested", r.FormValue("Name"), getHostname(r.Host)) + rKey = getRkey("requested", name, getHostname(r.Host)) exists = redisCli.Exists(ctx, rKey) if exists.Val() == 1 { w.WriteHeader(http.StatusConflict) @@ -79,7 +80,7 @@ func RequestNostrAddr(w http.ResponseWriter, r *http.Request) { // create the struct relays := make(map[string][]string) - names := map[string]string{r.FormValue("Name"): hexKey} + names := map[string]string{name: hexKey} user := nostrWellKnown{} if r.FormValue("Relays") != "" { relays = map[string][]string{ @@ -150,7 +151,7 @@ func GetNostrAddr(w http.ResponseWriter, r *http.Request) { l := logger.Get() // get query string for username r.ParseForm() - requestedName := r.FormValue("name") + requestedName := strings.ToLower(r.FormValue("name")) // connect to redis redisCli := redis.NostrRedisConn.Client