Mercurial > prosody-modules
comparison mod_invites_register_web/mod_invites_register_web.lua @ 6323:6216d85162dc
mod_invites_register_web: Fix loading resources from relative paths
Both module:get_option_path and module:load_resource makes the path
relative to the plugin resource directory, so when running form a source
checkout where this path is relative, the path was expanded relative to
itself, becoming duplicated.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 06 Sep 2025 20:57:57 +0200 |
| parents | 29a646bad096 |
| children | 8e73179c67f3 |
comparison
equal
deleted
inserted
replaced
| 6322:f110bce35630 | 6323:6216d85162dc |
|---|---|
| 32 module:depends("http"); | 32 module:depends("http"); |
| 33 | 33 |
| 34 local invites = module:depends("invites"); | 34 local invites = module:depends("invites"); |
| 35 local invites_page = module:depends("invites_page"); | 35 local invites_page = module:depends("invites_page"); |
| 36 | 36 |
| 37 local template_path = module:get_option_path("invites_register_template_path", "html"); | 37 local template_path = module:get_option_string("invites_register_template_path", "html"); |
| 38 function serve_register_page(event) | 38 function serve_register_page(event) |
| 39 local register_page_template = assert(module:load_resource(template_path .. "/register.html")):read("*a"); | 39 local register_page_template = assert(module:load_resource(template_path .. "/register.html")):read("*a"); |
| 40 | 40 |
| 41 local query_params = event.request.url.query and http_formdecode(event.request.url.query); | 41 local query_params = event.request.url.query and http_formdecode(event.request.url.query); |
| 42 | 42 |
