From 2c3801b97961345b4748a5f068531698a7aa75f5 Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Thu, 4 Jul 2002 08:13:19 +0000 Subject: [PATCH] Generate content-type header, if the user did not specify one of its own. Noticed by: Edin Kadribasic --- sapi/cgi/cgi_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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); -- 2.50.1