mod_http_authentication: Allow HTTP error events to pass through (fixes #1293)
authorKim Alvefur <zash@zash.se>
Tue, 15 Jan 2019 15:01:04 +0100
changeset 3446 05725785e3a6
parent 3445 0bff7d5ca81d
child 3447 284d8c18060e
mod_http_authentication: Allow HTTP error events to pass through (fixes #1293)
mod_http_authentication/mod_http_authentication.lua
--- a/mod_http_authentication/mod_http_authentication.lua	Mon Jan 14 10:56:19 2019 +0100
+++ b/mod_http_authentication/mod_http_authentication.lua	Tue Jan 15 15:01:04 2019 +0100
@@ -9,7 +9,7 @@
 
 module:wrap_object_event(server._events, false, function (handlers, event_name, event_data)
 	local request = event_data.request;
-	if request and not unauthed_endpoints[request.path] then
+	if event_name ~= "http-error" and request and not unauthed_endpoints[request.path] then
 		local response = event_data.response;
 		local headers = request.headers;
 		if not headers.authorization then