Comparison

plugins/mod_bosh.lua @ 11391:8eff5c744395

mod_bosh: Use message template from mod_http_error Looking Good! And most importantly, consistent.
author Kim Alvefur <zash@zash.se>
date Sun, 21 Feb 2021 06:17:40 +0100
parent 11126:cc6b1dab01a2
child 11392:a76493b75dec
comparison
equal deleted inserted replaced
11390:226fd5d3a295 11391:8eff5c744395
528 else 528 else
529 session:close({ condition = "bad-format", text = "Error processing stream" }); 529 session:close({ condition = "bad-format", text = "Error processing stream" });
530 end 530 end
531 end 531 end
532 532
533 local GET_response_body = [[<html><body> 533 local function GET_response(event)
534 <p>It works! Now point your BOSH client to this URL to connect to Prosody.</p> 534 return module:fire_event("http-message", {
535 <p>For more information see <a href="https://prosody.im/doc/setting_up_bosh">Prosody: Setting up BOSH</a>.</p> 535 response = event.response;
536 </body></html>]]; 536 ---
537 537 title = "Prosody BOSH endpoint";
538 local GET_response = { 538 message = "It works! Now point your BOSH client to this URL to connect to Prosody.";
539 headers = { 539 -- <p>For more information see <a href="https://prosody.im/doc/setting_up_bosh">Prosody: Setting up BOSH</a>.</p>
540 content_type = "text/html"; 540 }) or "This is the Prosody BOSH endpoint.";
541 }; 541 end
542 body = module:get_option_string("bosh_get_response_body", GET_response_body);
543 };
544 542
545 module:depends("http"); 543 module:depends("http");
546 module:provides("http", { 544 module:provides("http", {
547 default_path = "/http-bind"; 545 default_path = "/http-bind";
548 route = { 546 route = {