From f9c69a204ebd7ecabd022f6f6e9a7131a1ecadae Mon Sep 17 00:00:00 2001 From: fiaxh Date: Tue, 19 Nov 2019 21:50:46 +0100 Subject: Small changes to "Add support for HTTP Upload headers" --- xmpp-vala/src/module/xep/0363_http_file_upload.vala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'xmpp-vala/src') diff --git a/xmpp-vala/src/module/xep/0363_http_file_upload.vala b/xmpp-vala/src/module/xep/0363_http_file_upload.vala index ae7169e1..0a4d2c3f 100644 --- a/xmpp-vala/src/module/xep/0363_http_file_upload.vala +++ b/xmpp-vala/src/module/xep/0363_http_file_upload.vala @@ -78,7 +78,11 @@ public class Module : XmppStreamModule { foreach (StanzaNode node in iq.stanza.get_deep_subnodes(flag.ns_ver + ":slot", flag.ns_ver + ":put", flag.ns_ver + ":header")) { string header_name = node.get_attribute("name"); if (header_name == "Authorization" || header_name == "Cookie" || header_name == "Expires") { - slot_result.headers[header_name] = node.get_string_content(); + string? header_val = node.get_string_content(); + if (header_val != null && header_val.length < 8192) { + header_val = header_val.replace("\n", "").replace("\r", ""); + slot_result.headers[header_name] = header_val; + } } } -- cgit v1.2.3-70-g09d2