ugly service detection (#3)

This commit is contained in:
Michael Quigley 2022-07-26 17:30:06 -04:00
parent 7b7da0f6ac
commit 3d9a7107c0
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -7,6 +7,7 @@ import (
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"net/http"
"strings"
)
func Run(cfg *Config) error {
@ -32,5 +33,9 @@ type resolver struct {
func (r *resolver) Service(host string) string {
logrus.Infof("host = '%v'", host)
tokens := strings.Split(host, ".")
if len(tokens) > 0 {
return tokens[0]
}
return "zrok"
}