mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-27 11:31:06 +01:00
enable domain matching, removed unnecessary path_pattern check
This commit is contained in:
21
internal/net/http/serve_mux.go
Normal file
21
internal/net/http/serve_mux.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user