[svn-commits] mjordan: branch 1.8 r394899 - /branches/1.8/main/http.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Sat Jul 20 22:09:18 CDT 2013
Author: mjordan
Date: Sat Jul 20 22:09:16 2013
New Revision: 394899
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=394899
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
Modified:
branches/1.8/main/http.c
Modified: branches/1.8/main/http.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/http.c?view=diff&rev=394899&r1=394898&r2=394899
==============================================================================
--- branches/1.8/main/http.c (original)
+++ branches/1.8/main/http.c Sat Jul 20 22:09:16 2013
@@ -685,7 +685,7 @@
prev = v;
}
}
-
+
done:
ast_free(buf);
return post_vars;
@@ -862,7 +862,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