mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-21 08:39:03 +01:00
allow alias to match exact host
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user