Mercurial > prosody-modules
comparison mod_http_upload/mod_http_upload.lua @ 3176:d34f5d969940
mod_http_upload: use correct error condition
RFC 6120 defines internal-server-error, not internal-server-failure.
author | Jonas Wielicki <jonas@wielicki.name> |
---|---|
date | Sun, 08 Jul 2018 13:04:46 +0200 |
parents | 995836ee4f26 |
children | babb584e24a2 |
comparison
equal
deleted
inserted
replaced
3175:44c5d7310c33 | 3176:d34f5d969940 |
---|---|
138 local random_dir = uuid(); | 138 local random_dir = uuid(); |
139 local created, err = lfs.mkdir(join_path(storage_path, random_dir)); | 139 local created, err = lfs.mkdir(join_path(storage_path, random_dir)); |
140 | 140 |
141 if not created then | 141 if not created then |
142 module:log("error", "Could not create directory for slot: %s", err); | 142 module:log("error", "Could not create directory for slot: %s", err); |
143 return nil, st.error_reply(stanza, "wait", "internal-server-failure"); | 143 return nil, st.error_reply(stanza, "wait", "internal-server-error"); |
144 end | 144 end |
145 | 145 |
146 local ok = datamanager.list_append(username, host, module.name, { | 146 local ok = datamanager.list_append(username, host, module.name, { |
147 filename = filename, dir = random_dir, size = filesize, time = os.time() }); | 147 filename = filename, dir = random_dir, size = filesize, time = os.time() }); |
148 | 148 |
149 if not ok then | 149 if not ok then |
150 return nil, st.error_reply(stanza, "wait", "internal-server-failure"); | 150 return nil, st.error_reply(stanza, "wait", "internal-server-error"); |
151 end | 151 end |
152 | 152 |
153 local slot = random_dir.."/"..filename; | 153 local slot = random_dir.."/"..filename; |
154 pending_slots[slot] = origin.full_jid; | 154 pending_slots[slot] = origin.full_jid; |
155 | 155 |