plugins/mod_http_errors.lua
changeset 11668 d83f8f44caea
parent 11667 04fa947784bc
child 11824 0375ef78ed64
equal deleted inserted replaced
11667:04fa947784bc 11668:d83f8f44caea
    96 
    96 
    97 -- Something nicer shown instead of 404 at the root path, if nothing else handles this path
    97 -- Something nicer shown instead of 404 at the root path, if nothing else handles this path
    98 module:hook_object_event(server, "http-error", function (event)
    98 module:hook_object_event(server, "http-error", function (event)
    99 	local request, response = event.request, event.response;
    99 	local request, response = event.request, event.response;
   100 	if request and response and request.path == "/" and response.status_code == 404 then
   100 	if request and response and request.path == "/" and response.status_code == 404 then
       
   101 		response.status_code = 200;
   101 		response.headers.content_type = "text/html; charset=utf-8";
   102 		response.headers.content_type = "text/html; charset=utf-8";
   102 		local message = messages["/"];
   103 		local message = messages["/"];
   103 		return render(html, {
   104 		return render(html, {
   104 				icon_raw = icon,
   105 				icon_raw = icon,
   105 				title = "Prosody is running!";
   106 				title = "Prosody is running!";