[svn-commits] mjordan: branch 11 r394900 - in /branches/11: ./ main/http.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Jul 20 22:10:00 CDT 2013


Author: mjordan
Date: Sat Jul 20 22:09:59 2013
New Revision: 394900

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=394900
Log:
Tolerate presence of RFC2965 Cookie2 header by ignoring it

This patch modifies parsing of cookies in Asterisk's http server by doing an
explicit comparison of the "Cookie" header instead of looking at the first
6 characters to determine if the header is a cookie header. This avoids
parsing "Cookie2" headers and overwriting the previously parsed "Cookie"
header.

Note that we probably should be appending the cookies in each "Cookie"
header to the parsed results; however, while clients can send multiple
cookie headers they never really do. While this patch doesn't improve
Asterisk's behavior in that regard, it shouldn't make it any worse either.

Note that the solution in this patch was pointed out on the issue by the
issue reporter, Stuart Henderson.

(closes issue ASTERISK-21789)
Reported by: Stuart Henderson
Tested by: mjordan, Stuart Henderson
........

Merged revisions 394899 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/11/   (props changed)
    branches/11/main/http.c

Propchange: branches/11/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/11/main/http.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/http.c?view=diff&rev=394900&r1=394899&r2=394900
==============================================================================
--- branches/11/main/http.c (original)
+++ branches/11/main/http.c Sat Jul 20 22:09:59 2013
@@ -666,7 +666,7 @@
 			prev = v;
 		}
 	}
-	
+
 done:
 	ast_free(buf);
 	return post_vars;
@@ -843,7 +843,7 @@
 	struct ast_variable *v, *cookies=NULL;
 
 	for (v = headers; v; v = v->next) {
-		if (!strncasecmp(v->name, "Cookie", 6)) {
+		if (!strcasecmp(v->name, "Cookie")) {
 			char *tmp = ast_strdupa(v->value);
 			if (cookies) {
 				ast_variables_destroy(cookies);




More information about the svn-commits mailing list