/* XXX separate this mutator from the query */
/* Assume the object is OK.. remember the vary request headers */
e->mem_obj->vary_headers.assign(static_cast<const char *>(value), length);
+ /* entries created before SBuf vary handling may include string terminator */
+ static const SBuf nul("\0", 1);
+ e->mem_obj->vary_headers.trim(nul);
return true;
}
SBuf vary(e->mem_obj->vary_headers);
if (!vary.isEmpty()) {
- // TODO: do we still need +1 here? StoreMetaVary::checkConsistency
- // no longer relies on nul-termination, but other things might.
- t = StoreMeta::Factory(STORE_META_VARY_HEADERS, vary.length() + 1, vary.c_str());
+ t = StoreMeta::Factory(STORE_META_VARY_HEADERS, vary.length(), vary.c_str());
if (!t) {
storeSwapTLVFree(TLV);