mirror of
https://github.com/openziti/zrok.git
synced 2025-06-25 04:02:15 +02: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/pkg/errors"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Run(cfg *Config) error {
|
func Run(cfg *Config) error {
|
||||||
@ -32,5 +33,9 @@ type resolver struct {
|
|||||||
|
|
||||||
func (r *resolver) Service(host string) string {
|
func (r *resolver) Service(host string) string {
|
||||||
logrus.Infof("host = '%v'", host)
|
logrus.Infof("host = '%v'", host)
|
||||||
|
tokens := strings.Split(host, ".")
|
||||||
|
if len(tokens) > 0 {
|
||||||
|
return tokens[0]
|
||||||
|
}
|
||||||
return "zrok"
|
return "zrok"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user