Skip to content

Commit ed1519e

Browse files
committed
fix(param): prevent overwrite root alias if exists
1 parent cebf47f commit ed1519e

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/param/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ func normalize(p *Param) {
8080
_, hasRootBind := p.Binds["/"]
8181
if hasRootAlias || hasRootBind {
8282
p.EmptyRoot = false
83-
}
84-
if p.EmptyRoot {
83+
} else if p.EmptyRoot {
8584
p.Root = os.DevNull
8685
p.Aliases["/"] = os.DevNull
8786
} else {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
source "$root"/lib.bash
4+
5+
"$ghfs" -l 3003 -R -a :/:"$fs"/vhost1 &
6+
sleep 0.05 # wait server ready
7+
8+
file1status=$(curl_get_status http://127.0.0.1:3003/file1.txt)
9+
assert "$file1status" '200'
10+
11+
file1headstatus=$(curl_head_status http://127.0.0.1:3003/file1.txt)
12+
assert "$file1headstatus" '200'
13+
14+
jobs -p | xargs kill

0 commit comments

Comments
 (0)