From 5934470390d45948c61b1dd7748d9433ad74a553 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 17 Jan 2005 12:36:44 +0000 Subject: [PATCH] MFH - Fixed bug #31519: Set r->status_line to SAPI-provided status-line. --- sapi/apache2handler/sapi_apache2.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index cc4390bf12..b530d8c222 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -119,9 +119,17 @@ static int php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) { php_struct *ctx = SG(server_context); + const char *sline = SG(sapi_headers).http_status_line; ctx->r->status = SG(sapi_headers).http_response_code; + /* httpd requires that r->status_line is set to the first digit of + * the status-code: */ + if (sline && strlen(sline) > 12 && strncmp(sline, "HTTP/1.", 7) == 0 + && sline[8] == ' ') { + ctx->r->status_line = apr_pstrdup(ctx->r->pool, sline + 9); + } + return SAPI_HEADER_SENT_SUCCESSFULLY; } -- 2.40.0