Stop allowing credentialed cross-origin requests (closes #261)
check / check (push) Failing after 3s

CORS() allowed every origin with credentials, so a page on another
origin of the same site could read what the signed-in user sees. It
now uses the options of the CONVENTIONS.md template: every origin as
*, no credentials. It applies only to GET /api/v1/server and
GET /.well-known/healthcheck.json, the public read-only routes, since
REPO_POLICIES.md forbids * on authenticated routes. Every other route
sends no Access-Control-Allow-* header.

Model: opus-5-5
This commit is contained in:
clawbot committed 2026-11-10 23:13:19 +00:00
1 parent 72d8f2c12b
commit 9c8b70ed36
4 files changed
+101 -21

No files matched your search

+2 -3
View File
@@ -30,7 +30,6 @@ func (srv *Server) SetupRoutes() {
srv.router.Use(srv.mw.Metrics())
}
srv.router.Use(srv.mw.CORS())
srv.router.Use(srv.mw.CSP())
srv.router.Use(middleware.Timeout(routeTimeout))
@@ -45,7 +44,7 @@ func (srv *Server) SetupRoutes() {
}
// Health check.
srv.router.Get(
srv.router.With(srv.mw.CORS()).Get(
"/.well-known/healthcheck.json",
srv.handlers.HandleHealthCheck(),
)
@@ -69,7 +68,7 @@ func (srv *Server) SetupRoutes() {
}
func (srv *Server) setupAPIv1(router chi.Router) {
router.Get(
router.With(srv.mw.CORS()).Get(
"/server",
srv.handlers.HandleServerInfo(),
)