comparison mod_http_upload_external/mod_http_upload_external.lua @ 3166:44a187c82b53

mod_http_upload_external: Fix to read content-type from correct place in stanza
author Matthew Wild <mwild1@gmail.com>
date Mon, 02 Jul 2018 12:57:40 +0100
parents 7af4776a5dea
children bedd3f4a8f90
comparison
equal deleted inserted replaced
3165:7af4776a5dea 3166:44a187c82b53
92 module:hook("iq/host/"..legacy_namespace..":request", function (event) 92 module:hook("iq/host/"..legacy_namespace..":request", function (event)
93 local stanza, origin = event.stanza, event.origin; 93 local stanza, origin = event.stanza, event.origin;
94 local request = stanza.tags[1]; 94 local request = stanza.tags[1];
95 local filename = request:get_child_text("filename"); 95 local filename = request:get_child_text("filename");
96 local filesize = tonumber(request:get_child_text("size")); 96 local filesize = tonumber(request:get_child_text("size"));
97 local filetype = request.attr["content-type"] or "application/octet-stream"; 97 local filetype = request:get_child_text("content-type") or "application/octet-stream";
98 98
99 local get_url, put_url = handle_request( 99 local get_url, put_url = handle_request(
100 origin, stanza, legacy_namespace, filename, filesize, filetype); 100 origin, stanza, legacy_namespace, filename, filesize, filetype);
101 101
102 if not get_url then 102 if not get_url then