Github user shukitchan commented on a diff in the pull request:
https://github.com/apache/trafficserver/pull/1516#discussion_r103589725
--- Diff: plugins/esi/combo_handler.cc ---
@@ -187,6 +207,94 @@ InterceptData::~InterceptData()
}
}
+void
+CacheControlHeader::update(TSMBuffer bufp, TSMLoc hdr_loc)
+{
+ vector<string> values;
+ bool found_immutable = false;
+ bool found_private = false;
+
+ // Load each value from the Cache-Control header into the vector values
+ TSMLoc field_loc = TSMimeHdrFieldFind(bufp, hdr_loc,
TS_MIME_FIELD_CACHE_CONTROL, TS_MIME_LEN_CACHE_CONTROL);
+ if (field_loc != TS_NULL_MLOC) {
+ int n_values = TSMimeHdrFieldValuesCount(bufp, hdr_loc, field_loc);
+ if ((n_values != TS_ERROR) && (n_values > 0)) {
+ for (int i = 0; i < n_values; i++) {
+ // Grab this current header value
+ int _val_len = 0;
+ const char *_val = TSMimeHdrFieldValueStringGet(bufp, hdr_loc,
field_loc, i, &_val_len);
+ string val(_val, _val_len);
+
+ // We want the header value to be lowercase since CC headers are
case insensitive
+ transform(val.begin(), val.end(), val.begin(), ::tolower);
+ values.push_back(val);
+ }
+ } else {
+ TSHandleMLocRelease(bufp, hdr_loc, field_loc);
+ return;
+ }
+ TSHandleMLocRelease(bufp, hdr_loc, field_loc);
--- End diff --
This piece seems a bit redundant? from line 232 to 236, i mean
---
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.
---