diff options
| author | Edin Kadribasic <edink@php.net> | 2002-11-22 10:16:36 +0000 |
|---|---|---|
| committer | Edin Kadribasic <edink@php.net> | 2002-11-22 10:16:36 +0000 |
| commit | 837d371f50991ee6cbf5a3cfc2d95b9f2b1a1712 (patch) | |
| tree | 318662753116a9e6d178cde704dedc7a5519be6d /sapi/cgi | |
| parent | 0debfe11635fd663fff03efbfba219d95e95798f (diff) | |
| download | php-git-837d371f50991ee6cbf5a3cfc2d95b9f2b1a1712.tar.gz | |
MFH: Fixed bug #19207 by adding cgi.rfc2616_headers config directive.
Diffstat (limited to 'sapi/cgi')
| -rw-r--r-- | sapi/cgi/cgi_main.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index fe0748f865..a647f6a26e 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -241,8 +241,23 @@ static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) int len; sapi_header_struct *h; zend_llist_position pos; - - len = sprintf(buf, "Status: %d\r\n", SG(sapi_headers).http_response_code); + long rfc2616_headers = 0; + + /* Check wheater to send RFC2616 style headers compatible with + * PHP versions 4.2.3 and earlier compatible with web servers + * such as IIS. Default is informal CGI RFC header compatible + * with Apache. + */ + if (cfg_get_long("cgi.rfc2616_headers", &rfc2616_headers) == FAILURE) { + rfc2616_headers = 0; + } + + if (rfc2616_headers && SG(sapi_headers).http_status_line) { + len = sprintf(buf, "%s\r\n", SG(sapi_headers).http_status_line); + } else { + len = sprintf(buf, "Status: %d\r\n", SG(sapi_headers).http_response_code); + } + PHPWRITE_H(buf, len); if (SG(sapi_headers).send_default_content_type) { |
