waf.Server held its parts as public fields only for the tests to read. The tests now keep the Params the server was built from in a test-only wafAndParts, which embeds both, so every assertion reads as before. newWAFWith takes a change to the Params instead of a build function, so the Params kept are the ones the server was built from. Model: opus-5-5
This commit was merged in pull request #455.
This commit is contained in:
1 parent
2301a76029
commit
dcfdd12c51
16 files changed
+81
-99
No files matched your search
+1
-13
@@ -107,21 +107,9 @@ type CoreRuleSetInspector interface {
|
||||
) (coreruleset.Result, []byte, error)
|
||||
}
|
||||
|
||||
// Server is the server waf runs, with the parts of its Params. The tests
|
||||
// read them.
|
||||
// Server is the server waf runs.
|
||||
type Server struct {
|
||||
*http.Server
|
||||
|
||||
Ledger *bans.Ledger
|
||||
Limiter *ratelimit.Limiter
|
||||
GeoJS *geojs.GeoJS
|
||||
Anomalies *anomaly.Counters
|
||||
LookupFile *lookup.File
|
||||
Lists *reputation.Lists
|
||||
DNSBL *reputation.DNSBL
|
||||
AbuseIPDB *reputation.AbuseIPDB
|
||||
RouteWatch *routewatch.Client
|
||||
Metrics *metrics.Metrics
|
||||
}
|
||||
|
||||
// newHandler returns the handler with what every request shares, the parts
|
||||
|
||||
Reference in new issue
Block a user