rproxy: a page of its own for a refused visitor
check / check (push) Failing after 1m48s

A deny of 403 from waf is answered with refused.html, a deny of 429
with ratelimited.html, each as text/html with waf's other headers kept.
Both pages are made once at start and held in memory. With
SWW_RPROXY_CONTACT_EMAIL set, their "contact the site's operator" is a
mailto link to it; the value is taken as given.
This commit is contained in:
sneak committed 2026-11-19 21:12:31 -08:00
1 parent 5dfa47c97b
commit b157359910
8 files changed
+111 -3

No files matched your search

+3
View File
@@ -92,6 +92,7 @@ func New(params Params) *Server {
Path: wafprotocol.ReportPath,
}).String(),
breakerClock: time.Now,
pages: newBlockPages(params.Config.ContactEmail),
}
s := &Server{h: h}
@@ -156,6 +157,8 @@ type handler struct {
breakerClock func() time.Time
// reports are the goroutines sending reports to waf.
reports reportGoroutines
// pages are the pages a refused visitor gets.
pages blockPages
}
// newTransport returns what carries requests to the app. It never goes through