Skip to content

Commit e5f9b47

Browse files
author
Ilia Alshanetsky
committed
Fixed bug #38602 (header( "HTTP/1.0 ..." ) does not change proto version).
1 parent 1f061b3 commit e5f9b47

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ PHP NEWS
4545
read valid db). (Marcus)
4646
- Fixed bug #38680 (Added missing handling of basic types in json_decode).
4747
(Ilia)
48+
- Fixed bug #38602 (header( "HTTP/1.0 ..." ) does not change proto version).
49+
(Ilia)
4850
- Fixed bug #38536 (SOAP returns an array of values instead of an object).
4951
(Dmitry)
5052
- Fixed bug #33282 (Re-assignment by reference does not clear the is_ref flag)

sapi/apache2handler/sapi_apache2.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,14 @@ php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
129129

130130
/* httpd requires that r->status_line is set to the first digit of
131131
* the status-code: */
132-
if (sline && strlen(sline) > 12 && strncmp(sline, "HTTP/1.", 7) == 0
133-
&& sline[8] == ' ') {
132+
if (sline && strlen(sline) > 12 && strncmp(sline, "HTTP/1.", 7) == 0 && sline[8] == ' ') {
134133
ctx->r->status_line = apr_pstrdup(ctx->r->pool, sline + 9);
134+
ctx->r->proto_num = 1000 + (sline[7]-'0');
135+
if ((sline[7]-'0') == 0) {
136+
apr_table_set(ctx->r->subprocess_env, "force-response-1.0", "true");
137+
} else {
138+
apr_table_set(ctx->r->subprocess_env, "force-response-1.1", "true");
139+
}
135140
}
136141

137142
/* call ap_set_content_type only once, else each time we call it,

0 commit comments

Comments
 (0)