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 8f76497 commit 61bc75dCopy full SHA for 61bc75d
src/vhostHandler/main.go
@@ -65,14 +65,15 @@ func NewHandler(
65
}
66
67
var handler http.Handler
68
- if len(handlers) == 0 {
+ if len(handlers) == 1 {
69
handler = handlers["/"]
70
- } else {
+ }
71
+ if handler == nil {
72
serveMux := http.NewServeMux()
- for urlPath, handler := range handlers {
73
- serveMux.Handle(urlPath, handler)
+ for urlPath, urlHandler := range handlers {
74
+ serveMux.Handle(urlPath, urlHandler)
75
if len(urlPath) > 1 {
- serveMux.Handle(urlPath+"/", handler)
76
+ serveMux.Handle(urlPath+"/", urlHandler)
77
78
79
handler = serveMux
0 commit comments