diff --git a/gen_router.go b/gen_router.go index 30977b31..ba467035 100644 --- a/gen_router.go +++ b/gen_router.go @@ -728,7 +728,7 @@ func (r *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) { return } shost = spl[0] - if len(shost)==2 { + if len(spl)==2 { sport = spl[1] } } diff --git a/router_gen/main.go b/router_gen/main.go index c9517788..b185e04a 100644 --- a/router_gen/main.go +++ b/router_gen/main.go @@ -507,7 +507,7 @@ func (r *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) { return } shost = spl[0] - if len(shost)==2 { + if len(spl)==2 { sport = spl[1] } }