feat: sanitize alias hint before resolving

This commit is contained in:
Carlosokumu 2025-03-07 16:10:40 +03:00
parent 4af0e9709d
commit 6e437cb8e0
Signed by: carlos
GPG Key ID: 7BD6BC8160A5C953

View File

@ -11,6 +11,7 @@ import (
"net/http"
"net/url"
"regexp"
"strings"
"git.defalsify.org/vise.git/logging"
"git.grassecon.net/grassrootseconomics/sarafu-api/config"
@ -266,7 +267,9 @@ func (as *HTTPAccountService) RequestAlias(ctx context.Context, publicKey string
return nil, fmt.Errorf("The storage service cannot be nil")
}
if as.UseApi {
hint := as.ToFqdn(hint)
if !strings.Contains(hint, ".") {
hint = as.ToFqdn(hint)
}
enr, err := requestEnsAlias(ctx, publicKey, hint)
if err != nil {
return nil, err