feat: import Sea vHost single-server testing release
This commit is contained in:
commit
248badd33e
441 files changed
+63221
No files matched your search
@@ -0,0 +1,18 @@
|
||||
package httpapi
|
||||
|
||||
import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPMAAuditKeepsSQLAndUnknownWrites(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
method, route string
|
||||
want bool
|
||||
}{{"POST", "/config/get", false}, {"POST", "/config/set", false}, {"POST", "/navigation", false}, {"POST", "/sql", true}, {"POST", "/import", true}, {"POST", "/unrecognized", true}, {"POST", "", true}, {"GET", "/sql", false}} {
|
||||
r := httptest.NewRequest(tc.method, "https://control.vhost.ser888.cn/?route="+tc.route, nil)
|
||||
if pmaNeedsAudit(r) != tc.want {
|
||||
t.Fatalf("audit %s %s", tc.method, tc.route)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user