From c159187fde12d6cdf32f0740d3c6c1d453563f7a Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Tue, 20 Mar 2018 14:23:54 +0100 Subject: [PATCH] only put ';' if there's a parameter... --- src/content/content.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/content/content.cpp b/src/content/content.cpp index cf7e5d30c..6b6f055ea 100644 --- a/src/content/content.cpp +++ b/src/content/content.cpp @@ -228,7 +228,12 @@ const string &Content::getHeaderValue (const string &headerName) const { LinphoneContent *Content::toLinphoneContent () const { LinphoneContent *content = linphone_core_create_content(nullptr); linphone_content_set_type(content, getContentType().getType().c_str()); - string subtype = getContentType().getSubType() + ";" + getContentType().getParameter(); + string subtype; + string parameter = getContentType().getParameter(); + subtype = (parameter.empty()) + ? getContentType().getSubType() + : getContentType().getSubType() + ";" + parameter; + linphone_content_set_subtype(content, subtype.c_str()); linphone_content_set_buffer(content, (const uint8_t *)getBodyAsUtf8String().c_str(), getBodyAsUtf8String().size()); return content;