mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-25 01:38:30 +02:00
small string split join optimization
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/yusing/go-proxy/internal/route/routes"
|
||||
route "github.com/yusing/go-proxy/internal/route/types"
|
||||
"github.com/yusing/go-proxy/internal/task"
|
||||
"github.com/yusing/go-proxy/internal/utils/strutils"
|
||||
)
|
||||
|
||||
var findRouteFunc = findRouteAnyDomain
|
||||
@@ -124,7 +125,7 @@ func Handler(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func findRouteAnyDomain(host string) (route.HTTPRoute, error) {
|
||||
hostSplit := strings.Split(host, ".")
|
||||
hostSplit := strutils.SplitRune(host, '.')
|
||||
n := len(hostSplit)
|
||||
switch {
|
||||
case n == 3:
|
||||
|
||||
Reference in New Issue
Block a user