mirror of
https://github.com/php/php-src.git
synced 2025-01-11 05:24:49 +08:00
Fixed bug #41378 (fastcgi protocol lacks support for Reason-Phrase in "Status:" header)
This commit is contained in:
parent
1c48c054ce
commit
24bc130c56
@ -320,7 +320,16 @@ static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
|
||||
}
|
||||
|
||||
} else {
|
||||
len = sprintf(buf, "Status: %d\r\n", SG(sapi_headers).http_response_code);
|
||||
char *s;
|
||||
|
||||
if (SG(sapi_headers).http_status_line &&
|
||||
(s = strchr(SG(sapi_headers).http_status_line, ' ')) != 0 &&
|
||||
(s - SG(sapi_headers).http_status_line) >= 5 &&
|
||||
strncasecmp(SG(sapi_headers).http_status_line, "HTTP/", 5) == 0) {
|
||||
len = sprintf(buf, "Status:%s\r\n", s);
|
||||
} else {
|
||||
len = sprintf(buf, "Status: %d\r\n", SG(sapi_headers).http_response_code);
|
||||
}
|
||||
}
|
||||
|
||||
PHPWRITE_H(buf, len);
|
||||
|
Loading…
Reference in New Issue
Block a user