enable domain matching, removed unnecessary path_pattern check

This commit is contained in:
yusing
2024-12-02 04:39:46 +08:00
parent 58cfba7695
commit 3f9d73d784
5 changed files with 29 additions and 100 deletions

View File

@@ -0,0 +1,21 @@
package http
import "net/http"
type ServeMux struct {
*http.ServeMux
}
func NewServeMux() ServeMux {
return ServeMux{http.NewServeMux()}
}
func (mux ServeMux) HandleFunc(pattern string, handler http.HandlerFunc) (err error) {
defer func() {
if r := recover(); r != nil {
err = r.(error)
}
}()
mux.ServeMux.HandleFunc(pattern, handler)
return
}