allow alias to match exact host

This commit is contained in:
yusing 2024-12-02 05:01:55 +08:00
parent 3f9d73d784
commit cd749ac6a4

View file

@ -49,6 +49,14 @@ func SetMiddlewares(mws []map[string]any) error {
func Handler(w http.ResponseWriter, r *http.Request) {
mux, err := findRouteFunc(r.Host)
if err != nil {
// try find with exact match
r, ok := routes.GetHTTPRoute(r.Host)
if ok {
mux = r
err = nil
}
}
if err == nil {
if epMiddleware != nil {
epMiddlewareMu.Lock()