mirror of
https://github.com/alibaba/higress.git
synced 2026-06-08 04:07:31 +08:00
feat: 【frontend-gray】添加 skipedRoutes以及skipedByHeaders 配置 (#1409)
Co-authored-by: Kent Dong <ch3cho@qq.com>
This commit is contained in:
@@ -108,22 +108,20 @@ func TestPrefixFileRewrite(t *testing.T) {
|
||||
|
||||
func TestIsPageRequest(t *testing.T) {
|
||||
var tests = []struct {
|
||||
fetchMode string
|
||||
p string
|
||||
output bool
|
||||
p string
|
||||
output bool
|
||||
}{
|
||||
{"cors", "/js/a.js", false},
|
||||
{"no-cors", "/js/a.js", false},
|
||||
{"no-cors", "/images/a.png", false},
|
||||
{"no-cors", "/index", true},
|
||||
{"cors", "/inde", false},
|
||||
{"no-cors", "/index.html", true},
|
||||
{"no-cors", "/demo.php", true},
|
||||
{"/js/a.js", false},
|
||||
{"/js/a.js", false},
|
||||
{"/images/a.png", false},
|
||||
{"/index", true},
|
||||
{"/index.html", true},
|
||||
{"/demo.php", true},
|
||||
}
|
||||
for _, test := range tests {
|
||||
testPath := test.p
|
||||
t.Run(testPath, func(t *testing.T) {
|
||||
output := IsPageRequest(test.fetchMode, testPath)
|
||||
output := IsPageRequest(testPath)
|
||||
assert.Equal(t, test.output, output)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user