mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-19 20:32:35 +02:00
allow alias to match exact host
This commit is contained in:
parent
3f9d73d784
commit
cd749ac6a4
1 changed files with 8 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue