Changeset

6224:0bd1804baae7

mod_http_libjs: Remove compatibility with 0.11
author Link Mauve <linkmauve@linkmauve.fr>
date Wed, 09 Apr 2025 19:04:49 +0200
parents 6223:767b8594fb9d
children 6225:2b20236bce3e
files mod_http_libjs/mod_http_libjs.lua
diffstat 1 files changed, 3 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_libjs/mod_http_libjs.lua	Wed Apr 09 19:04:39 2025 +0200
+++ b/mod_http_libjs/mod_http_libjs.lua	Wed Apr 09 19:04:49 2025 +0200
@@ -1,16 +1,10 @@
+local http_files = require "net.http.files";
+
 local mime_map = module:shared("/*/http_files/mime").types or {
 	css = "text/css",
 	js = "application/javascript",
 };
 
-local serve;
-if prosody.process_type == "prosody" then
-	local http_files = require "net.http.files";
-	serve = http_files.serve;
-else
-	serve = module:depends"http_files".serve;
-end
-
 local libjs_path = module:get_option_string("libjs_path", "/usr/share/javascript");
 
 do -- sanity check
@@ -25,6 +19,6 @@
 module:provides("http", {
 		default_path = "/share";
 		route = {
-			["GET /*"] = serve({ path = libjs_path, mime_map = mime_map });
+			["GET /*"] = http_files.serve({ path = libjs_path, mime_map = mime_map });
 		}
 	});