优化结构
This commit is contained in:
@@ -23,7 +23,6 @@ func DefaultIgnoredAPIs(staticPath string) []IgnoredAPI {
|
||||
{Method: "POST", Path: "/base/captcha"},
|
||||
{Method: "POST", Path: "/init/initdb"},
|
||||
{Method: "POST", Path: "/init/checkdb"},
|
||||
{Method: "GET", Path: "/info/getInfoDataSource"},
|
||||
{Method: "GET", Path: "/info/getInfoPublic"},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,3 +20,11 @@ func TestDefaultIgnoredAPIsIncludeSwagger(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestDefaultIgnoredAPIsDoNotHideAnnouncementDataSource(t *testing.T) {
|
||||
for _, api := range DefaultIgnoredAPIs("uploads/file") {
|
||||
if api.Method == "GET" && api.Path == "/info/getInfoDataSource" {
|
||||
t.Fatal("announcement data-source endpoint must remain protected by the normal API policy")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user