| 366 | } |
| 367 | |
| 368 | void |
| 369 | Variables::_parseCookieString(const char *str, int str_len) |
| 370 | { |
| 371 | AttributeList cookies; |
| 372 | Utils::parseAttributes(str, str_len, cookies, ";,"); |
| 373 | for (auto &iter : cookies) { |
| 374 | std::string cookie = iter.name; |
| 375 | size_t pos = cookie.find('='); |
| 376 | |
| 377 | if (pos != std::string::npos) { |
| 378 | cookie = cookie.substr(0, pos); |
| 379 | } |
| 380 | |
| 381 | bool found = false; |
| 382 | for (auto &_allowlistCookie : _allowlistCookies) { |
| 383 | if ((_allowlistCookie == "*") || (_allowlistCookie == cookie)) { |
| 384 | found = true; |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | if (found == true) { |
| 389 | _insert(_dict_data[HTTP_COOKIE], string(iter.name, iter.name_len), string(iter.value, iter.value_len)); |
| 390 | DBG("[%s] Inserted cookie with name [%.*s] and value [%.*s]", __FUNCTION__, iter.name_len, iter.name, iter.value_len, |
| 391 | iter.value); |
| 392 | } |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | void |
| 397 | Variables::_parseUserAgentString(const char * /* str ATS_UNUSED */, int /* str_len ATS_UNUSED */) |
nothing calls this directly
no test coverage detected