]> granicus.if.org Git - php/commitdiff
Generate content-type header, if the user did not specify one of its own.
authorSascha Schumann <sas@php.net>
Thu, 4 Jul 2002 08:13:19 +0000 (08:13 +0000)
committerSascha Schumann <sas@php.net>
Thu, 4 Jul 2002 08:13:19 +0000 (08:13 +0000)
Noticed by: Edin Kadribasic <edink@proventum.net>

sapi/cgi/cgi_main.c

index c24043b02df619a5514fe6114672a84bcc12b790..ad4d634169ab8a3d5cb0fe781b2dac7b01f6e9e6 100644 (file)
@@ -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);