diff options
author | Igor Sysoev <igor@sysoev.ru> | 2019-06-10 18:47:35 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2019-06-10 18:47:35 +0300 |
commit | 1f8c395fc0bc9d1a18391a2ae3b0f282b91ff19c (patch) | |
tree | 4aea9e540bc49f421337901561fad323c512cdc0 /src | |
parent | b2a06204838096f03a41aac9a3a365a04f6b719a (diff) | |
download | unit-1f8c395fc0bc9d1a18391a2ae3b0f282b91ff19c.tar.gz unit-1f8c395fc0bc9d1a18391a2ae3b0f282b91ff19c.tar.bz2 |
Cookie-based routing should be case-sensitive.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_http_route.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/nxt_http_route.c b/src/nxt_http_route.c index d6749acb..ade44666 100644 --- a/src/nxt_http_route.c +++ b/src/nxt_http_route.c @@ -475,7 +475,7 @@ nxt_http_route_match_create(nxt_task_t *task, nxt_router_temp_conf_t *tmcf, if (mtcf.cookies != NULL) { table = nxt_http_route_table_create(task, mp, mtcf.cookies, - NXT_HTTP_ROUTE_COOKIE, 0); + NXT_HTTP_ROUTE_COOKIE, 1); if (table == NULL) { return NULL; } @@ -613,7 +613,7 @@ nxt_http_route_rule_name_create(nxt_task_t *task, nxt_mp_t *mp, c = name->start[i]; *p++ = c; - c = nxt_lowcase(c); + c = case_sensitive ? c : nxt_lowcase(c); hash = nxt_http_field_hash_char(hash, c); } @@ -1452,7 +1452,6 @@ nxt_http_route_cookie(nxt_array_t *array, u_char *name, size_t name_length, for (p = name; p < name + name_length; p++) { c = *p; - c = nxt_lowcase(c); hash = nxt_http_field_hash_char(hash, c); } @@ -1483,8 +1482,7 @@ nxt_http_route_test_cookie(nxt_http_request_t *r, if (rule->u.name.hash == nv->hash && rule->u.name.length == nv->name_length - && nxt_strncasecmp(rule->u.name.start, nv->name, nv->name_length) - == 0) + && nxt_memcmp(rule->u.name.start, nv->name, nv->name_length) == 0) { ret = nxt_http_route_test_rule(r, rule, nv->value, nv->value_length); |