MDL-34068 mod_chat Sending text/html headers when sending the messages frame output...
authorDavid Monllao <davidm@moodle.com>
Thu, 6 Sep 2012 01:14:44 +0000 (09:14 +0800)
committerDavid Monllao <davidm@moodle.com>
Fri, 7 Sep 2012 04:10:36 +0000 (12:10 +0800)
mod/chat/chatd.php

index f255c17..a2cd366 100644 (file)
@@ -538,8 +538,18 @@ EOD;
 
         // $this->trace('QUIRKS value for this connection is '.$customdata['quirks']);
 
+        $header  = "HTTP/1.1 200 OK\n";
+        $header .= "Connection: close\n";
+        $header .= "Date: ".date('r')."\n";
+        $header .= "Server: Moodle\n";
+        $header .= "Content-Type: text/html; charset=utf-8\n";
+        $header .= "Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT\n";
+        $header .= "Cache-Control: no-cache, must-revalidate\n";
+        $header .= "Expires: Wed, 4 Oct 1978 09:32:45 GMT\n";
+        $header .= "\n";
+
         $this->dismiss_half($sessionid, false);
-        $this->write_data($this->conn_sets[$sessionid][CHAT_CONNECTION_CHANNEL], $CHAT_HTMLHEAD_JS);
+        $this->write_data($this->conn_sets[$sessionid][CHAT_CONNECTION_CHANNEL], $header . $CHAT_HTMLHEAD_JS);
         $this->trace('Connection accepted: '.$this->conn_sets[$sessionid][CHAT_CONNECTION_CHANNEL].', SID: '.$sessionid.' UID: '.$chatuser->userid.' GID: '.$chatuser->groupid, E_USER_WARNING);
 
         // Finally, broadcast the "entered the chat" message