From 8d83e1977358db4659b324bc1add3901d9101dea Mon Sep 17 00:00:00 2001 From: vibpe <79282744+vibpe@users.noreply.github.com> Date: Fri, 20 Nov 2026 14:51:54 +0100 Subject: [PATCH] Send the 419 status with a reason phrase so Apache does not answer 500 (4.0 backport) (#1213) Backport of #1209 to `postfixadmin_4.0`, as asked for there. Refs #1208. fix http 419 status header to include reason phrase. thanks @vibpe --- public/common.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/common.php b/public/common.php index f1871bc9..dd21b2e6 100644 --- a/public/common.php +++ b/public/common.php @@ -4,7 +4,10 @@ require_once(dirname(__FILE__) . '/../common.php'); function pfa_handle_invalid_token(): void { - http_response_code(419); // HTTP 419 Page Expired. + // 419 is not a registered status code: without an explicit reason phrase + // Apache replaces the status line with "500 Internal Server Error". + // Always HTTP/1.1: mod_php only applies a status line starting with "HTTP/1.". + header('HTTP/1.1 419 Page Expired', true, 419); $returnUrl = 'main.php'; $title = Config::lang('session_expired_title') ?: 'Session expired';