aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2019-11-19 21:50:46 +0100
committerfiaxh <git@lightrise.org>2019-11-19 21:50:46 +0100
commitf9c69a204ebd7ecabd022f6f6e9a7131a1ecadae (patch)
tree6cae6738e5b05108a9d0f84a7f9e1f41a5a2d43e /xmpp-vala/src/module/xep
parent687ec1a15969a88e00f84b6f45f751c99cc91d92 (diff)
downloaddino-f9c69a204ebd7ecabd022f6f6e9a7131a1ecadae.tar.gz
dino-f9c69a204ebd7ecabd022f6f6e9a7131a1ecadae.zip
Small changes to "Add support for HTTP Upload headers"
Diffstat (limited to 'xmpp-vala/src/module/xep')
-rw-r--r--xmpp-vala/src/module/xep/0363_http_file_upload.vala6
1 files changed, 5 insertions, 1 deletions
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;
+ }
}
}