优化结构

This commit is contained in:
Yvan
2026-08-21 16:09:27 +08:00
parent a1fea67e79
commit e22301f8f6
4 changed files with 162 additions and 5 deletions
-1
View File
@@ -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")
}
}
}