Skip to content

Commit c07d913

Browse files
committed
add test for allowing root directory
1 parent e21b99a commit c07d913

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internal/config/types_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ func TestTypes_isAllowedDir(t *testing.T) {
116116
},
117117
filePath: "/etc/nginx/level1/level2/level3/level4/nginx.conf",
118118
},
119+
{
120+
name: "Test 13: Root directory is allowed, file in subdirectory",
121+
allowed: true,
122+
allowedDirs: []string{
123+
"/",
124+
},
125+
filePath: "/etc/nginx/nginx.conf",
126+
},
119127
}
120128

121129
for _, test := range tests {

0 commit comments

Comments
 (0)