mod_http_errors: Set status code 200 from root page
authorKim Alvefur <zash@zash.se>
Fri, 09 Jul 2021 22:06:58 +0200
changeset 11668 d83f8f44caea
parent 11667 04fa947784bc
child 11669 148075532021
mod_http_errors: Set status code 200 from root page It isn't quite an error.
plugins/mod_http_errors.lua
--- a/plugins/mod_http_errors.lua	Fri Jul 09 21:55:14 2021 +0200
+++ b/plugins/mod_http_errors.lua	Fri Jul 09 22:06:58 2021 +0200
@@ -98,6 +98,7 @@
 module:hook_object_event(server, "http-error", function (event)
 	local request, response = event.request, event.response;
 	if request and response and request.path == "/" and response.status_code == 404 then
+		response.status_code = 200;
 		response.headers.content_type = "text/html; charset=utf-8";
 		local message = messages["/"];
 		return render(html, {