diff options
author | Joe Orton <jorton@php.net> | 2005-01-17 12:24:40 +0000 |
---|---|---|
committer | Joe Orton <jorton@php.net> | 2005-01-17 12:24:40 +0000 |
commit | 8288c451c0981147a65efd600c5e01bce27d4bc7 (patch) | |
tree | e44bed7d072234060681df1bf073f0c03ca75645 /sapi | |
parent | da7001a6c317bebe4533f8cd1fea404425bb3cef (diff) | |
download | php-git-8288c451c0981147a65efd600c5e01bce27d4bc7.tar.gz |
Fixed bug #31519: Set r->status_line to SAPI-provided status-line.
Diffstat (limited to 'sapi')
-rw-r--r-- | sapi/apache2handler/sapi_apache2.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index 7bb061f504..5afca21fa7 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -121,9 +121,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; } |