0af9ccda
web: guard mutations with ecore's csrf, cache and panic middleware
checkSameOrigin and originMatches are gone, and with them the three per-handler calls that had to be remembered: csrf.Require sits over the whole browser group, so the mutating route added next year is guarded by being routed. The internal provisioning endpoint stays outside that group deliberately — it is a service-to-service POST with no Origin and its own network-key guard. middleware.PrivateCache marks every page as one no cache may reuse for the next viewer, which is only correct because the static handler opts out per asset once it has found the file. RecoverPanics answers a panic with the error page, and one that arrives after the response has started by dropping the connection rather than appending an error to half a document.
Eugene Blikh <bigbes@gmail.com> — 2026-08-08 19:46:55 UTC
Commit 0af9ccda90ae2e1068c8a79fb1209df17cd41394 —
view raw patch
Parent(s):
17fa0f16
| File | Status | + | − |
|---|---|---|---|
web/csrf.go
|
D | -47 | |
web/handlers_keys.go
|
M | +2 | -5 |
web/handlers_repo.go
|
M | +2 | -6 |
web/handlers_settings.go
|
M | +3 | -6 |
web/router.go
|
M | +54 | -22 |
web/web_test.go
|
M | +77 | -10 |