From 1c363caf5d2c1d9ae1e850ad2499a59f68a9b0b2 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 15 May 2012 13:35:09 +0100 Subject: mod_bosh: Set Content-Type to text/html for GET response (thanks Medics) --- plugins/mod_bosh.lua | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'plugins') 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 [[ -

It works! Now point your BOSH client to this URL to connect to Prosody.

-

For more information see Prosody: Setting up BOSH.

-]]; -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 = [[ +

It works! Now point your BOSH client to this URL to connect to Prosody.

+

For more information see Prosody: Setting up BOSH.

+ ]]; +}; + 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; -- cgit v1.2.3