fix(api): 限制公开接口分页结果窗口 (#45)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
@@ -116,6 +116,19 @@ func TestSearchProducts(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestPaginationResultWindowBoundary(t *testing.T) {
|
||||
h, _ := newTestHandler(t)
|
||||
for _, path := range []string{
|
||||
"/api/" + APIVersion + "/products/search?page=100&size=100",
|
||||
"/api/" + APIVersion + "/brands?page=100&size=100",
|
||||
} {
|
||||
rec := doGET(t, h, path)
|
||||
if rec.Code != http.StatusOK {
|
||||
t.Fatalf("%s: status = %d, body = %s", path, rec.Code, rec.Body.String())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestSearchFuzzyAndFilters(t *testing.T) {
|
||||
h, _ := newTestHandler(t)
|
||||
ctx := context.Background()
|
||||
|
||||
Reference in New Issue
Block a user