gitea/routers/web
silverwind 42d294941c
Replace CSRF cookie with CrossOriginProtection (#36183)
Removes the CSRF cookie in favor of
[`CrossOriginProtection`](https://pkg.go.dev/net/http#CrossOriginProtection)
which relies purely on HTTP headers.

Fixes: https://github.com/go-gitea/gitea/issues/11188
Fixes: https://github.com/go-gitea/gitea/issues/30333
Helps: https://github.com/go-gitea/gitea/issues/35107

TODOs:

- [x] Fix tests
- [ ] Ideally add tests to validates the protection

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-12-25 12:33:34 +02:00
..
admin Convert locale files from ini to json format (#35489) 2025-12-19 09:50:48 -08:00
auth Replace CSRF cookie with CrossOriginProtection (#36183) 2025-12-25 12:33:34 +02:00
devtest fix: auto-expand and auto-scroll for actions logs (#35570) (#35583) 2025-10-05 10:31:06 +08:00
events Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
explore Convert locale files from ini to json format (#35489) 2025-12-19 09:50:48 -08:00
feed Fix context usages (#35348) 2025-08-27 11:00:01 +00:00
healthcheck Always enable caches (#28527) 2023-12-19 09:29:05 +00:00
misc Support selecting theme on the footer (#35741) 2025-10-28 18:25:00 +08:00
org Convert locale files from ini to json format (#35489) 2025-12-19 09:50:48 -08:00
repo Fix panic in blame view when a file has only a single commit (#36230) 2025-12-23 14:26:29 +08:00
shared when using rules to delete packages, remove unclean bugs (#34632) 2025-06-18 04:47:49 +00:00
user Replace CSRF cookie with CrossOriginProtection (#36183) 2025-12-25 12:33:34 +02:00
base.go Redirect to a presigned URL of HEAD for HEAD requests (#35088) 2025-07-16 11:22:45 +00:00
githttp.go Replace CSRF cookie with CrossOriginProtection (#36183) 2025-12-25 12:33:34 +02:00
goget.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
home.go Support actions and reusable workflows from private repos (#32562) 2025-10-25 17:37:33 +00:00
metrics.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
nodeinfo.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
passkey.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
swagger_json.go Improve OAuth2 provider (correct Issuer, respect ENABLED) (#34966) 2025-07-06 13:36:45 +08:00
web.go Replace CSRF cookie with CrossOriginProtection (#36183) 2025-12-25 12:33:34 +02:00
webfinger.go Fix context usages (#35348) 2025-08-27 11:00:01 +00:00