We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f867efa commit ab6c123Copy full SHA for ab6c123
src/vhostHandler/main.go
@@ -62,14 +62,18 @@ func NewHandler(
62
}
63
64
var handler http.Handler
65
- serveMux := &http.ServeMux{}
66
- for urlPath, handler := range handlers {
67
- serveMux.Handle(urlPath, handler)
68
- if len(urlPath) > 1 {
69
- serveMux.Handle(urlPath+"/", handler)
+ if len(handlers) == 0 {
+ handler = handlers["/"]
+ } else {
+ serveMux := http.NewServeMux()
+ for urlPath, handler := range handlers {
70
+ serveMux.Handle(urlPath, handler)
71
+ if len(urlPath) > 1 {
72
+ serveMux.Handle(urlPath+"/", handler)
73
+ }
74
75
+ handler = serveMux
76
- handler = serveMux
77
78
vhostHandler := &VhostHandler{
79
p: p,
0 commit comments