Skip to content

Commit a28a7cb

Browse files
committed
fix: correct formatting of generated SYNTH records
Fixes #467 Signed-off-by: Aurora Gaffney <[email protected]>
1 parent 6f0a3fd commit a28a7cb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

internal/indexer/handshake.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"errors"
1313
"fmt"
1414
"log/slog"
15+
"strings"
1516
"time"
1617

1718
"github.com/blinklabs-io/cdnsd/handshake"
@@ -249,10 +250,13 @@ func handshakeResourceDataToDomainRecords(domainName string, resData handshake.D
249250
if ip4 == nil {
250251
return nil, fmt.Errorf("Synth4 record has invalid IPv4 address: %s", r.Address.String())
251252
}
253+
base32Enc := base32.HexEncoding.WithPadding(base32.NoPadding)
252254
nsName := fmt.Sprintf(
253255
"_%s._synth.",
254-
base32.HexEncoding.EncodeToString(
255-
ip4,
256+
strings.ToLower(
257+
base32Enc.EncodeToString(
258+
ip4,
259+
),
256260
),
257261
)
258262
ret = append(

0 commit comments

Comments
 (0)