We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e91874 commit 3ff8c35Copy full SHA for 3ff8c35
src/utils.c
@@ -412,7 +412,21 @@ const char *cookie_get(http_message_t *request, const char *key)
412
cookie = httpmessage_REQUEST(request, str_Cookie);
413
if (cookie != NULL)
414
{
415
- value = strstr(cookie, key);
+ key = strstr(cookie, key);
416
+ const char *end = cookie + strlen(cookie);
417
+ const char *value = key;
418
+ if (key != NULL)
419
+ {
420
+ while (value[0] != '\0' )
421
422
+ if (value[0] == ';')
423
+ value = end;
424
+ else if (value[0] == '=')
425
+ break;
426
+ else
427
+ value++;
428
+ }
429
430
}
431
return value;
432
0 commit comments