comparison mod_muc_log_http/muc_log_http/mod_muc_log_http.lua @ 383:4099f0837936

mod_muc_log_http: Added assertion to ensure proper failure on empty responses.
author Waqas Hussain <waqas20@gmail.com>
date Mon, 25 Jul 2011 02:21:40 +0500
parents 19469f3ad6d6
children 79983e658bb5
comparison
equal deleted inserted replaced
382:19469f3ad6d6 383:4099f0837936
69 end 69 end
70 return false; 70 return false;
71 end 71 end
72 72
73 function createDoc(body) 73 function createDoc(body)
74 if body then 74 assert(body, "<nil> HTTP response");
75 body = body:gsub("%%", "%%%%"); 75 body = body:gsub("%%", "%%%%");
76 return html.doc:gsub("###BODY_STUFF###", body); 76 return html.doc:gsub("###BODY_STUFF###", body);
77 end
78 end 77 end
79 78
80 function urlunescape (escapedUrl) 79 function urlunescape (escapedUrl)
81 escapedUrl = escapedUrl:gsub("+", " ") 80 escapedUrl = escapedUrl:gsub("+", " ")
82 escapedUrl = escapedUrl:gsub("%%(%x%x)", function(h) return strchar(tonumber(h,16)) end) 81 escapedUrl = escapedUrl:gsub("%%(%x%x)", function(h) return strchar(tonumber(h,16)) end)