Skip to content

Commit

Permalink
some notes
Browse files Browse the repository at this point in the history
  • Loading branch information
M4tteoP committed Sep 24, 2024
1 parent f90124d commit 8957ac4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions testing/coreruleset/.ftw.yml
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
11 changes: 4 additions & 7 deletions testing/coreruleset/coreruleset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 8957ac4

Please sign in to comment.