cvs: php4 /sapi/cgi cgi_main.c
| From: | Sascha Schumann | Date: | Thu, 04 Jul 2002 08:13:21 +0000 |
| Subject: | cvs: php4 /sapi/cgi cgi_main.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-12708@lists.php.net to get a copy of this message | ||
sas Thu Jul 4 04:13:21 2002 EDT
Modified files:
/php4/sapi/cgi cgi_main.c
Log:
Generate content-type header, if the user did not specify one of its own.
Noticed by: Edin Kadribasic <edink@proventum.net>
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.176 php4/sapi/cgi/cgi_main.c:1.177
--- php4/sapi/cgi/cgi_main.c:1.176 Wed Jul 3 07:46:37 2002
+++ php4/sapi/cgi/cgi_main.c Thu Jul 4 04:13:19 2002
@@ -211,6 +211,16 @@
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);