Diff

mod_admin_web/admin_web/mod_admin_web.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
parent 2871:c3317f61f3f9
child 3550:8079e9c6d419
line wrap: on
line diff
--- a/mod_admin_web/admin_web/mod_admin_web.lua	Wed Apr 03 11:57:37 2019 +0200
+++ b/mod_admin_web/admin_web/mod_admin_web.lua	Fri Apr 05 18:57:51 2019 +0200
@@ -122,7 +122,15 @@
 	module:depends("bosh");
 	module:depends("admin_adhoc");
 	module:depends("http");
-	local serve_file = 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
+	local serve_file = serve {
 		path = module:get_directory() .. "/www_files";
 	};