From 5860017b9f13b7849ac62cb532b8f8a6ffb45bea Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 21 Feb 2021 06:17:40 +0100 Subject: mod_bosh: Use message template from mod_http_error Looking Good! And most importantly, consistent. --- plugins/mod_bosh.lua | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'plugins/mod_bosh.lua') diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua index 6393a73e..db281fcd 100644 --- a/plugins/mod_bosh.lua +++ b/plugins/mod_bosh.lua @@ -530,17 +530,15 @@ function stream_callbacks.error(context, error) end end -local GET_response_body = [[ -

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

-

For more information see Prosody: Setting up BOSH.

- ]]; - -local GET_response = { - headers = { - content_type = "text/html"; - }; - body = module:get_option_string("bosh_get_response_body", GET_response_body); -}; +local function GET_response(event) + return module:fire_event("http-message", { + response = event.response; + --- + title = "Prosody BOSH endpoint"; + message = "It works! Now point your BOSH client to this URL to connect to Prosody."; + --

For more information see Prosody: Setting up BOSH.

+ }) or "This is the Prosody BOSH endpoint."; +end module:depends("http"); module:provides("http", { -- cgit v1.2.3