diff --git a/api.go b/api.go index 9006e759..6324cca1 100644 --- a/api.go +++ b/api.go @@ -407,7 +407,7 @@ func (h *Headscale) getLegacyMapResponseData( } var respBody []byte - if mapRequest.Compress == "zstd" { + if mapRequest.Compress == ZstdCompression { src, err := json.Marshal(resp) if err != nil { log.Error(). @@ -445,7 +445,7 @@ func (h *Headscale) getMapKeepAliveResponse( } var respBody []byte var err error - if mapRequest.Compress == "zstd" { + if mapRequest.Compress == ZstdCompression { src, err := json.Marshal(mapResponse) if err != nil { log.Error(). diff --git a/utils.go b/utils.go index b4362535..089e867b 100644 --- a/utils.go +++ b/utils.go @@ -59,6 +59,8 @@ const ( privateHexPrefix = "privkey:" PermissionFallback = 0o700 + + ZstdCompression = "zstd" ) func MachinePublicKeyStripPrefix(machineKey key.MachinePublic) string {