mirror of
https://github.com/openziti/zrok.git
synced 2024-11-21 23:53:19 +01:00
ugly service detection (#3)
This commit is contained in:
parent
7b7da0f6ac
commit
3d9a7107c0
@ -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"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user