summaryrefslogtreecommitdiff
path: root/main/http.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2013-07-21 03:10:41 +0000
committerMatthew Jordan <mjordan@digium.com>2013-07-21 03:10:41 +0000
commitbdb1c6bfb03b5734f637f8678c1bc08910c1bc82 (patch)
treed3ed40379ee50318e5214d3840d841360140a27a /main/http.c
parent44fe8fcb91922c72601b76bae410df29faddc17d (diff)
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 ........ Merged revisions 394900 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394901 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/http.c')
-rw-r--r--main/http.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/http.c b/main/http.c
index 971fbe24c..745f126cc 100644
--- a/main/http.c
+++ b/main/http.c
@@ -857,7 +857,7 @@ struct ast_variable *ast_http_get_cookies(struct ast_variable *headers)
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);