From 0d0042b7e6a61d0cf6564351c68ec76e1910c01b Mon Sep 17 00:00:00 2001 From: Juan Font Alonso Date: Sun, 14 Aug 2022 17:04:07 +0200 Subject: [PATCH] Added zstd constant for linting --- api.go | 4 ++-- utils.go | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) 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 {