Skip to content

Commit de5071a

Browse files
committed
presence: make sure Content-Type is parsed
(cherry picked from commit 5949135)
1 parent 1237093 commit de5071a

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

modules/presence/publish.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,10 +544,13 @@ int handle_publish(struct sip_msg* msg, str* sender_uri)
544544
goto error;
545545
}
546546

547-
if(sphere_enable && event->evp->parsed == EVENT_PRESENCE &&
548-
get_content_type(msg)== SUBTYPE_PIDFXML)
549-
{
550-
sphere= extract_sphere(body);
547+
if(sphere_enable && event->evp->parsed == EVENT_PRESENCE) {
548+
if (parse_content_type_hdr(msg)< 0) {
549+
LM_ERR("cannot parse content type\n");
550+
goto error;
551+
}
552+
if(get_content_type(msg)== SUBTYPE_PIDFXML)
553+
sphere= extract_sphere(body);
551554
}
552555
}
553556
}

0 commit comments

Comments
 (0)