Comparison

plugins/mod_c2s.lua @ 9784:7fa273f8869e

mod_c2s, mod_s2s, mod_component: Log invalid XML escaped (fixes #734) See 6ed0d6224d64
author Kim Alvefur <zash@zash.se>
date Tue, 15 Jan 2019 20:08:30 +0100
parent 9739:a74d78f79b23
child 9910:7a703af90c9c
comparison
equal deleted inserted replaced
9783:4c91afc43639 9784:7fa273f8869e
288 if data then 288 if data then
289 data = filter("bytes/in", data); 289 data = filter("bytes/in", data);
290 if data then 290 if data then
291 local ok, err = stream:feed(data); 291 local ok, err = stream:feed(data);
292 if not ok then 292 if not ok then
293 log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "):gsub("[%z\1-\31]", "_")); 293 log("debug", "Received invalid XML (%s) %d bytes: %q", tostring(err), #data, data:sub(1, 300));
294 session:close("not-well-formed"); 294 session:close("not-well-formed");
295 end 295 end
296 end 296 end
297 end 297 end
298 end 298 end