From 8957ac484afccacfccdad6efa93bbd663169448e Mon Sep 17 00:00:00 2001 From: Matteo Pace Date: Wed, 25 Sep 2024 00:07:48 +0200 Subject: [PATCH] some notes --- testing/coreruleset/.ftw.yml | 1 + testing/coreruleset/coreruleset_test.go | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/testing/coreruleset/.ftw.yml b/testing/coreruleset/.ftw.yml index 0430651da..5e3d8df92 100644 --- a/testing/coreruleset/.ftw.yml +++ b/testing/coreruleset/.ftw.yml @@ -1,6 +1,7 @@ --- testoverride: ignore: + 920100-4: 'Invalid uri, Coraza not reached - 404 page not found' 920100-5: 'Invalid uri, Coraza not reached - 404 page not found' 930110-7: 'CRS issue: https://github.com/coreruleset/coreruleset/issues/3736' diff --git a/testing/coreruleset/coreruleset_test.go b/testing/coreruleset/coreruleset_test.go index 3529d35a9..cc14cba40 100644 --- a/testing/coreruleset/coreruleset_test.go +++ b/testing/coreruleset/coreruleset_test.go @@ -221,16 +221,13 @@ SecRule REQUEST_HEADERS:X-CRS-Test "@rx ^.*$" \ t.Fatal(err) } + // CRS regression tests are expected to be run with https://github.com/coreruleset/albedo as backend server s := httptest.NewServer(txhttp.WrapHandler(waf, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // CRS regression tests are expected to be run with https://github.com/coreruleset/albedo as backend server defer r.Body.Close() + // TODO: Investigate why we need to enforce text/plain to have response body tests working. + // Check the Content-Type set by albed and SecResponseBodyMimeType w.Header().Set("Content-Type", "text/plain") - switch { - case r.URL.Path == "/reflect": - albedo.Handler().ServeHTTP(w, r) - default: - // Albedo return 200 with no body - } + albedo.Handler().ServeHTTP(w, r) }))) defer s.Close()