Mercurial > prosody-modules
comparison mod_http_upload/mod_http_upload.lua @ 2193:40824a38d505
mod_http_upload: Return nil if no upload slot is found (should prevent conflicts between multiple instances on the same path)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 31 May 2016 17:24:59 +0200 |
parents | bb8f7785aed7 |
children | c45ad4b7aaa3 |
comparison
equal
deleted
inserted
replaced
2192:bb8f7785aed7 | 2193:40824a38d505 |
---|---|
82 | 82 |
83 -- http service | 83 -- http service |
84 local function upload_data(event, path) | 84 local function upload_data(event, path) |
85 if not pending_slots[path] then | 85 if not pending_slots[path] then |
86 module:log("warn", "Attempt to upload to unknown slot %q", path); | 86 module:log("warn", "Attempt to upload to unknown slot %q", path); |
87 return 401; | 87 return; -- 404 |
88 end | 88 end |
89 local random, filename = path:match("^([^/]+)/([^/]+)$"); | 89 local random, filename = path:match("^([^/]+)/([^/]+)$"); |
90 if not random then | 90 if not random then |
91 return 400; | 91 return 400; |
92 end | 92 end |