summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-11 14:50:00 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-11 14:50:00 +0000
commita9d2bf330c99c98fd1ea638c37953c83209294b4 (patch)
tree22ae2899141d91f5eaf1f7364d3b5fcc0fe8da87
parenta922e944e81f03664de455b391777c9f59a74215 (diff)
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
-rw-r--r--src/modules/m_httpd.cpp10
1 files changed, 8 insertions, 2 deletions
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()