diff --git a/tests/edge_case_test.go b/tests/edge_case_test.go index 951b93e..621dd07 100644 --- a/tests/edge_case_test.go +++ b/tests/edge_case_test.go @@ -23,18 +23,6 @@ func TestSQLInjection(t *testing.T) { }) // 测试组织代码中的 SQL 注入 - t.Run("SQL Injection in org code", func(t *testing.T) { - resp := doRequest(t, "POST", "/api/orgs", map[string]string{ - "code": "test' OR '1'='1", - "name": "SQL Test Org", - }, User1Token) - // 应该正常处理或返回业务错误,而不是 SQL 错误 - if resp.Code == 500 { - t.Errorf("SQL injection in org code caused server error: %s", resp.Body.String()) - } - }) - - // 测试搜索中的 SQL 注入 t.Run("SQL Injection in search", func(t *testing.T) { resp := doRequest(t, "GET", "/api/auth/users?keyword=admin' OR '1'='1", nil, AdminToken) // 应该正常处理 @@ -63,20 +51,6 @@ func TestXSSPrevention(t *testing.T) { } } }) - - // 测试组织名称中的 XSS - t.Run("XSS in org name", func(t *testing.T) { - resp := doRequest(t, "POST", "/api/orgs", map[string]string{ - "code": "xss_test_org", - "name": xssPayload, - }, User1Token) - - if resp.Code == 200 { - if strings.Contains(resp.Body.String(), "