Browse Source

modules_k/msilo: send composed body only if content type is text/plain

Juha Heinanen 16 năm trước cách đây
mục cha
commit
64e15b63e4
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      modules_k/msilo/msilo.c

+ 7 - 1
modules_k/msilo/msilo.c

@@ -1044,7 +1044,13 @@ static int m_dump(struct sip_msg* msg, char* owner, char* str2)
 			
 		/** sending using TM function: t_uac */
 		body_str.len = 1024;
-		n = m_build_body(&body_str, rtime, str_vals[2/*body*/], 0);
+		/* send composed body only if content type is text/plain */
+		if ((str_vals[3].len == 10) &&
+		    (strncmp(str_vals[3].s, "text/plain", 10) == 0)) {
+		    n = m_build_body(&body_str, rtime, str_vals[2/*body*/], 0);
+		} else {
+		    n = -1;
+		}
 		if(n<0)
 			LM_DBG("sending simple body\n");
 		else