Tests: rproxy gives a refused visitor a page of its own

A deny of 403 from waf gets rproxy's refused page, a deny of 429 its
rate-limited page, each as text/html with waf's other headers kept. With
SWW_RPROXY_CONTACT_EMAIL set, the pages' sentence about the operator is a
mailto link. Every other answer from waf still goes to the visitor as waf
gave it. The two pages are beside the code, as the tests read them.
This commit is contained in:
sneak committed 2026-11-19 21:10:10 -08:00
1 parent 8219664ad1
commit 5dfa47c97b
4 files changed
+237 -30

No files matched your search

+2
View File
@@ -25,6 +25,7 @@ const (
rproxyMaxResponse = "SWW_RPROXY_MAX_RESPONSE_SIZE"
rproxyRequestTime = "SWW_RPROXY_MAX_REQUEST_TIME_MS"
rproxyAnswerTime = "SWW_RPROXY_MAX_RESPONSE_TIME_MS"
rproxyContactEmail = "SWW_RPROXY_CONTACT_EMAIL"
backendURL = "http://waf:8080"
rproxyNoAnswerAddr = ":8080"
rproxyNoAnswerApp = "http://127.0.0.1:8081"
@@ -250,6 +251,7 @@ func TestRProxySettingsAreLoggedByName(t *testing.T) {
rproxyListen, rproxyUpstream, rproxyTrusted, wafBackend, wafBackendTimeout,
rproxyNoAnswer,
rproxyMaxRequest, rproxyMaxResponse, rproxyRequestTime, rproxyAnswerTime,
rproxyContactEmail,
} {
if !slices.Contains(names, name) {
t.Errorf("%s is not logged, only %v", name, names)