Github user zwoop commented on a diff in the pull request:
https://github.com/apache/trafficserver/pull/798#discussion_r71084358
--- Diff: plugins/experimental/esi/lib/Variables.cc ---
@@ -357,9 +357,26 @@ Variables::_parseCookieString(const char *str, int
str_len)
AttributeList cookies;
Utils::parseAttributes(str, str_len, cookies, ";,");
for (AttributeList::iterator iter = cookies.begin(); iter !=
cookies.end(); ++iter) {
- _insert(_dict_data[HTTP_COOKIE], string(iter->name, iter->name_len),
string(iter->value, iter->value_len));
- _debugLog(_debug_tag, "[%s] Inserted cookie with name [%.*s] and value
[%.*s]", __FUNCTION__, iter->name_len, iter->name,
- iter->value_len, iter->value);
+ std::string v = iter->name;
+ size_t eq = v.find("=");
+
+ if (eq != std::string::npos) {
+ v = v.substr(0, eq);
+ }
+
+ bool found = false;
+ for (Utils::HeaderValueList::iterator lz = _whitelistCookies.begin();
lz != _whitelistCookies.end(); ++lz) {
+ std::string c = *lz;
--- End diff --
Maybe this is the norm for the esi, but why create this intermediary
std::string c? That seems inefficient and unnecessary ? Can't you just use the
*lz ?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---