diff options
author | Sascha Schumann <sas@php.net> | 2002-07-04 08:13:19 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 2002-07-04 08:13:19 +0000 |
commit | 2c3801b97961345b4748a5f068531698a7aa75f5 (patch) | |
tree | a6bdb396b9f1a03f2e8e1523cda24459e3b80d66 /sapi/cgi | |
parent | b47ad58321ceaa76999b7a6d9bf8fe0b3dd21785 (diff) | |
download | php-git-2c3801b97961345b4748a5f068531698a7aa75f5.tar.gz |
Generate content-type header, if the user did not specify one of its own.
Noticed by: Edin Kadribasic <edink@proventum.net>
Diffstat (limited to 'sapi/cgi')
-rw-r--r-- | sapi/cgi/cgi_main.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index c24043b02d..ad4d634169 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -211,6 +211,16 @@ static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) 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) { + char *hd; + + hd = sapi_get_default_content_type(TSRMLS_C); + PHPWRITE("Content-type: ", sizeof("Content-type: ")-1); + PHPWRITE(hd, strlen(hd)); + PHPWRITE("\r\n", 2); + efree(hd); + } + h = zend_llist_get_first_ex(&sapi_headers->headers, &pos); while (h) { PHPWRITE_H(h->header, h->header_len); |