aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-05-15 13:35:09 +0100
committerMatthew Wild <mwild1@gmail.com>2012-05-15 13:35:09 +0100
commitdac7d9c03f6234c91dd67c98010931ede21ba2b7 (patch)
treef532f38dfcf486b47dfa024359355673f3c20360
parent9eab3dfed9d4bcbb5f9ee1527fd5ddfa13f77d5a (diff)
downloadprosody-dac7d9c03f6234c91dd67c98010931ede21ba2b7.tar.gz
prosody-dac7d9c03f6234c91dd67c98010931ede21ba2b7.zip
mod_bosh: Set Content-Type to text/html for GET response (thanks Medics)
-rw-r--r--plugins/mod_bosh.lua22
1 files changed, 13 insertions, 9 deletions
diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua
index 24dc3755..8b612286 100644
--- a/plugins/mod_bosh.lua
+++ b/plugins/mod_bosh.lua
@@ -98,13 +98,6 @@ function on_destroy_request(request)
end
end
-local function handle_GET(request)
- return [[<html><body>
- <p>It works! Now point your BOSH client to this URL to connect to Prosody.</p>
- <p>For more information see <a href="http://prosody.im/doc/setting_up_bosh">Prosody: Setting up BOSH</a>.</p>
-</body></html>]];
-end
-
function handle_OPTIONS(request)
local headers = {};
for k,v in pairs(default_headers) do headers[k] = v; end
@@ -428,13 +421,24 @@ function on_timer()
end
module:add_timer(1, on_timer);
+
+local GET_response = {
+ headers = {
+ content_type = "text/html";
+ };
+ body = [[<html><body>
+ <p>It works! Now point your BOSH client to this URL to connect to Prosody.</p>
+ <p>For more information see <a href="http://prosody.im/doc/setting_up_bosh">Prosody: Setting up BOSH</a>.</p>
+ </body></html>]];
+};
+
function module.add_host(module)
module:depends("http");
module:provides("http", {
default_path = "/http-bind";
route = {
- ["GET"] = handle_GET;
- ["GET /"] = handle_GET;
+ ["GET"] = GET_response;
+ ["GET /"] = GET_response;
["OPTIONS"] = handle_OPTIONS;
["OPTIONS /"] = handle_OPTIONS;
["POST"] = handle_POST;