gitea: only route GETs to Anubis on expensive paths #1162

Closed
JakeHillion wants to merge 1 commits from jj/rrzllvptvuko into main
pull from: jj/rrzllvptvuko
1 Commits
Author SHA1 Message Date
JakeHillion 0e4c7a2f1e gitea: only route GETs to Anubis on expensive paths
commit-validation / validate-single-commit (pull_request) Successful in 8s
buildbot/nix-eval Build done. (881 warnings)
buildbot/nix-build Build done.
Submitting the PR creation form (POST to /:owner/:repo/compare/...) was
being intercepted by Anubis because the @expensive matcher in the gitea
vhost matched on path alone, regardless of method. Anubis would respond
with a challenge HTML page; the form navigation then rendered the
challenge, but solving it issues a GET redirect back to the original
URL, dropping the POST body. The form was unsubmittable.

Restricted the @expensive matcher to GET and HEAD. Scrapers - the
intended target of the Anubis gate - only ever GET these paths, so
nothing they do escapes the gate; POSTs (PR creation, etc.) now fall
through to gitea directly.

Test plan:
- CI
- create a PR via the web UI on gitea.hillion.co.uk and confirm the
  form submits without an Anubis interstitial
2026-06-08 20:59:18 +01:00