mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 01:08:31 +02: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) {
|
func Handler(w http.ResponseWriter, r *http.Request) {
|
||||||
mux, err := findRouteFunc(r.Host)
|
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 err == nil {
|
||||||
if epMiddleware != nil {
|
if epMiddleware != nil {
|
||||||
epMiddlewareMu.Lock()
|
epMiddlewareMu.Lock()
|
||||||
|
|||||||
Reference in New Issue
Block a user