From 15830af5b190cfb6f28e0bdf0f4bf110256ed9ef Mon Sep 17 00:00:00 2001 From: haturatu Date: Mon, 13 Oct 2025 00:08:25 +0900 Subject: fix(csrf): js csrf support --- handlers/php_proxy.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'handlers/php_proxy.go') diff --git a/handlers/php_proxy.go b/handlers/php_proxy.go index d30f363..24a38dc 100644 --- a/handlers/php_proxy.go +++ b/handlers/php_proxy.go @@ -13,6 +13,7 @@ import ( "strconv" "strings" + "github.com/gorilla/csrf" fcgiclient "github.com/tomasen/fcgi_client" ) @@ -78,6 +79,9 @@ func NewPhpProxyHandler(scriptName string) http.Handler { env["AUTH_PATH_ADMIN_USERS_API"] = config.Paths.AdminUsersAPI env["AUTH_ASSETS_PATH"] = config.Paths.Assets + // Pass CSRF token to PHP + env["HTTP_X_CSRF_TOKEN"] = csrf.Token(r) + // Asynchronously log the proxying action to avoid blocking the request. worker.Submit(workerPool, func() { -- cgit v1.2.3