# HG changeset patch # User Link Mauve # Date 1744218289 -7200 # Node ID 0bd1804baae77ea445b6588b2ea9e50a386bb05b # Parent 767b8594fb9da7211c24409e9252ab8833df2cf5 mod_http_libjs: Remove compatibility with 0.11 diff -r 767b8594fb9d -r 0bd1804baae7 mod_http_libjs/mod_http_libjs.lua --- 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 }); } });