diff mod_password_reset/mod_password_reset.lua @ 3549:b059a3fb2a58

Update modules using mod_http_files to serve files for change in Prosody trunk See commits in Prosody: f1594893998f afc48785f738 a39f3681d685 c93fdec624c7
author Kim Alvefur <zash@zash.se>
date Fri, 05 Apr 2019 18:57:51 +0200
parents 3bc68057f232
children 7fc6a63c3bd0
line wrap: on
line diff
--- a/mod_password_reset/mod_password_reset.lua	Wed Apr 03 11:57:37 2019 +0200
+++ b/mod_password_reset/mod_password_reset.lua	Fri Apr 05 18:57:51 2019 +0200
@@ -14,7 +14,13 @@
 
 local max_token_age = module:get_option_number("password_reset_validity", 86400);
 
-local serve = module:depends"http_files".serve;
+local serve;
+if not pcall(function ()
+	local http_files = require "net.http.files";
+	serve = http_files.serve;
+end) then
+	serve = module:depends"http_files".serve;
+end
 
 module:depends("adhoc");
 module:depends("http");