Mercurial > prosody-modules
comparison mod_http_upload/mod_http_upload.lua @ 4976:75b6e5df65f9
various: Improve error reporting if missing file server module on 0.12
If there is some error loading net.http.files then it would be swallowed
by the pcall and then it would proceed to trying mod_http_files, which
might cause unexpected behavior on 0.12
Ref #1765
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 18 Jul 2022 22:47:54 +0200 |
parents | ea17cfcbffab |
children |
comparison
equal
deleted
inserted
replaced
4975:733e5513f691 | 4976:75b6e5df65f9 |
---|---|
55 module:log("warn", "mod_%s loaded on a user host, this may be incompatible with some client software, see docs for correct usage", module.name); | 55 module:log("warn", "mod_%s loaded on a user host, this may be incompatible with some client software, see docs for correct usage", module.name); |
56 end | 56 end |
57 | 57 |
58 local http_files; | 58 local http_files; |
59 | 59 |
60 if not pcall(function () | 60 if prosody.process_type == "prosody" then |
61 http_files = require "net.http.files"; | 61 http_files = require "net.http.files"; |
62 end) then | 62 else |
63 http_files = module:depends"http_files"; | 63 http_files = module:depends"http_files"; |
64 end | 64 end |
65 | 65 |
66 local mime_map = module:shared("/*/http_files/mime").types; | 66 local mime_map = module:shared("/*/http_files/mime").types; |
67 if not mime_map then | 67 if not mime_map then |