From 68dab0fe7b68e0abf8a3f78d42194c4f8b88de67 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Fri, 29 Oct 2021 17:04:58 +0000 Subject: [PATCH] Move localhost check to utils --- app.go | 8 -------- utils.go | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app.go b/app.go index eedc8739..c77a85a5 100644 --- a/app.go +++ b/app.go @@ -221,14 +221,6 @@ func (h *Headscale) watchForKVUpdatesWorker() { // more functions will come here in the future } -func IsLocalhost(host string) bool { - if strings.Contains(host, LOCALHOST_V4) || strings.Contains(host, LOCALHOST_V6) { - return true - } - - return false -} - func (h *Headscale) grpcAuthenticationInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, diff --git a/utils.go b/utils.go index cbe1d870..1aa31712 100644 --- a/utils.go +++ b/utils.go @@ -156,3 +156,11 @@ func tailNodesToString(nodes []*tailcfg.Node) string { func tailMapResponseToString(resp tailcfg.MapResponse) string { return fmt.Sprintf("{ Node: %s, Peers: %s }", resp.Node.Name, tailNodesToString(resp.Peers)) } + +func IsLocalhost(host string) bool { + if strings.Contains(host, LOCALHOST_V4) || strings.Contains(host, LOCALHOST_V6) { + return true + } + + return false +}