r3102 - trunk/libmsip/source/headers

mikma at minisip.org mikma at minisip.org
Wed Jan 10 15:33:35 CET 2007


Author: mikma
Date: 2007-01-10 15:33:34 +0100 (Wed, 10 Jan 2007)
New Revision: 3102

Modified:
   trunk/libmsip/source/headers/SipHeader.cxx
Log:
Header types are case insensitive.


Modified: trunk/libmsip/source/headers/SipHeader.cxx
===================================================================
--- trunk/libmsip/source/headers/SipHeader.cxx	2007-01-10 14:14:03 UTC (rev 3101)
+++ trunk/libmsip/source/headers/SipHeader.cxx	2007-01-10 14:33:34 UTC (rev 3102)
@@ -195,13 +195,14 @@
  	//cerr << "PARSEHDR: valueline parsed to "<< valueline<< endl;
 
 	string headerType = findHeaderType(line);
+	string ht = upCase(headerType);
 	char valueSeparator;
 	char paramSeparator;
 
-	if( headerType == "WWW-Authenticate" ||
-			headerType == "Proxy-Authenticate" ||
-			headerType == "Authorization" ||
-			headerType == "Proxy-Authorization" ){
+	if( ht == "WWW-AUTHENTICATE" ||
+			ht == "PROXY-AUTHENTICATE" ||
+			ht == "AUTHORIZATION" ||
+			ht == "PROXY-AUTHORIZATION" ){
 		valueSeparator = '\0';
 		paramSeparator = ',';
 	} else {
@@ -220,11 +221,11 @@
 		}
 		// 			cerr << "PARSER: First value+params line: "<< values[i]<<""<<endl;
 
-		if( headerType == "Accept-Contact" ) {
+		if( ht == "ACCEPT-CONTACT" ) {
 			value_params = split(values[i],true,'\n');
 			value_zero = value_params[0];
 			// 				cerr<<"valueline.substr(2): "+valueline.substr(2)<<endl;
-		} else if( headerType == "Contact" ) {
+		} else if( ht == "CONTACT" ) {
 			size_t ltPos = values[i].find( '<' );
 			size_t gtPos = values[i].find( '>' );
 			if( ltPos!=string::npos && gtPos!=string::npos ) {
@@ -242,10 +243,10 @@
 				value_params = split(values[i],true,';');
 				value_zero = value_params[0];
 			}
-		} else if( headerType == "From" ||
-				headerType == "To" ||
-			   headerType == "Route" ||
-			   headerType == "Record-Route" ) {
+		} else if( ht == "FROM" ||
+				ht == "TO" ||
+			   ht == "ROUTE" ||
+			   ht == "RECORD-ROUTE" ) {
 			size_t ltPos = values[i].find( '<' );
 			size_t gtPos = values[i].find( '>' );
 			if( ltPos!=string::npos && gtPos!=string::npos ) {
@@ -291,7 +292,6 @@
 		//Special case for headers that are allowed to exist
 		//without any header value. This list is compatibel 
 		//with: RFC3261, RFC3262(none)
-		string ht = upCase(headerType);
 		if ( 		ht=="ACCEPT" || 
 				ht=="ACCEPT-ENCODING" ||
 				ht=="ACCEPT-LANGUAGE" ||



More information about the Minisip-devel mailing list