Commit 2db718a2 authored by baire's avatar baire
Browse files

support for parameters in Content-Type

parent ef203906
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -185,6 +185,10 @@ bool is_tel_scheme (const char * pszScheme) {

#define SIPREG_GPARAM_VALUE "(([" SIPCHARS_ALFANUM ".!%*_+`'~\\-:]+)|(" SIPREG_QUOTED_STRING "))"

// content type parameter
#define SIPREG_M_PARAMETER	SIPREG_TOKEN SIPREG_EQUAL "(?:" SIPREG_TOKEN "|" SIPREG_QUOTED_STRING ")"


bool detect_comma(Buffer & buffer) throw (DecodeError)
{
	Regex reg_comma ("^" SIPREG_COMMA);
@@ -1772,7 +1776,7 @@ void ContentLength::PreDecode (Buffer& buffer) throw (DecodeError)

void ContentType::PreDecodeField (int id, Buffer& buffer) throw (DecodeError)
{
	static Regex reg_ctype ("^" SIPREG_TOKEN "/" SIPREG_TOKEN);
	static Regex reg_ctype ("^" SIPREG_TOKEN "/" SIPREG_TOKEN "(" SIPREG_SEMI SIPREG_M_PARAMETER ")*");
	if (id == id_mediaType)
	{
		reg_ctype.AssertMatch (buffer, this);