Skip to content

Commit 8f76497

Browse files
committed
feat(vhostHandler): use DevNull as empty-root path
1 parent 7d646d8 commit 8f76497

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/vhostHandler/main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"../tpl"
99
"../user"
1010
"net/http"
11+
"os"
1112
)
1213

1314
type VhostHandler struct {
@@ -49,8 +50,12 @@ func NewHandler(
4950
_, hasRootAlias := aliases["/"]
5051
emptyRoot := false
5152
if !hasRootAlias {
52-
aliases["/"] = p.Root
5353
emptyRoot = p.EmptyRoot
54+
if emptyRoot {
55+
aliases["/"] = os.DevNull
56+
} else {
57+
aliases["/"] = p.Root
58+
}
5459
}
5560

5661
handlers := map[string]http.Handler{}

0 commit comments

Comments
 (0)