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:
1 parent
5dfa47c97b
commit
b157359910
8 files changed
+111
-3
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user