bunker: fix concurrent map writes (url.Values is a map).

This commit is contained in:
fiatjaf
2026-05-16 23:16:30 -03:00
parent a2f109c8c8
commit 35d628ef6d

View File

@@ -6,6 +6,7 @@ import (
"encoding/hex"
"errors"
"fmt"
"maps"
"net"
"net/url"
"os"
@@ -251,8 +252,10 @@ var bunker = &cli.Command{
// this function will be called every now and then
printBunkerInfo := func() {
qs.Set("secret", newSecret)
bunkerURI := fmt.Sprintf("bunker://%s?%s", pubkey.Hex(), qs.Encode())
iqs := make(url.Values)
maps.Copy(iqs, qs)
iqs.Set("secret", newSecret)
bunkerURI := fmt.Sprintf("bunker://%s?%s", pubkey.Hex(), iqs.Encode())
authorizedKeysStr := ""
if len(config.Clients) != 0 {