From a9d2bf330c99c98fd1ea638c37953c83209294b4 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 11 Jul 2006 14:50:00 +0000 Subject: Allow modules to change the content-type of the document (defaults to text/html) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4337 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_httpd.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index 73683640e..58dece323 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -169,10 +169,16 @@ class HttpSocket : public InspSocket struct tm *timeinfo = localtime(&TIME); this->Write("HTTP/1.1 "+ConvToStr(response)+" "+Response(response)+"\r\nDate: "); this->Write(asctime(timeinfo)); - if (!extraheaders.empty()) + if (extraheaders.empty()) + { + this->Write("Content-Type: text/html\r\n"); + } + else + { this->Write(extraheaders); + } this->Write("Server: InspIRCd/m_httpd.so/1.1\r\nContent-Length: "+ConvToStr(size)+ - "\r\nConnection: close\r\nContent-Type: text/html\r\n\r\n"); + "\r\nConnection: close\r\n\r\n"); } virtual bool OnDataReady() -- cgit v1.2.3