Comparison

mod_http_upload/mod_http_upload.lua @ 2288:827f01cbf6ba

mod_http_upload: Handle case of non-existant path
author Kim Alvefur <zash@zash.se>
date Tue, 23 Aug 2016 02:13:34 +0200
parent 2287:e1a8c2324937
child 2443:7f9ff36dc8d5
comparison
equal deleted inserted replaced
2287:e1a8c2324937 2288:827f01cbf6ba
86 reply:tag("slot", { xmlns = xmlns_http_upload }); 86 reply:tag("slot", { xmlns = xmlns_http_upload });
87 local random = uuid(); 87 local random = uuid();
88 pending_slots[random.."/"..filename] = origin.full_jid; 88 pending_slots[random.."/"..filename] = origin.full_jid;
89 local base_url = module:http_url(); 89 local base_url = module:http_url();
90 local slot_url = url.parse(base_url); 90 local slot_url = url.parse(base_url);
91 slot_url.path = url.parse_path(slot_url.path); 91 slot_url.path = url.parse_path(slot_url.path or "/");
92 t_insert(slot_url.path, random); 92 t_insert(slot_url.path, random);
93 t_insert(slot_url.path, filename); 93 t_insert(slot_url.path, filename);
94 slot_url.path.is_directory = false; 94 slot_url.path.is_directory = false;
95 slot_url.path = url.build_path(slot_url.path); 95 slot_url.path = url.build_path(slot_url.path);
96 slot_url = url.build(slot_url); 96 slot_url = url.build(slot_url);