Software /
code /
prosody
Changeset
12113:86e6f0810956
mod_http: Clean up redirects handlers for wildcard on http module unload
These would previously be left behind. Probably mostly harmless except
for clogging up the `debug:events()` listing in the console.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 22 Dec 2021 19:27:03 +0100 |
parents | 12112:08a949e63541 |
children | 12114:e32f90c81519 |
files | plugins/mod_http.lua |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_http.lua Wed Dec 22 18:47:45 2021 +0100 +++ b/plugins/mod_http.lua Wed Dec 22 19:27:03 2021 +0100 @@ -227,6 +227,13 @@ for event_name, handlers in pairs(app_handlers) do module:unhook_object_event(server, event_name, handlers.main); module:unhook_object_event(server, event_name, handlers.cors); + + if event_name:sub(-2, -1) == "/*" then + module:unhook_object_event(server, event_name:sub(1, -3), redir_handler, -1); + elseif event_name:sub(-1, -1) == "/" then + module:unhook_object_event(server, event_name:sub(1, -2), redir_handler, -1); + end + local options_event_name = event_name:gsub("^%S+", "OPTIONS"); module:unhook_object_event(server, options_event_name, handlers.options); end