21 std::string combineCookieCrumbsSorted(std::vector<std::string> crumbs) {
23 sort(crumbs.begin(), crumbs.end());
24 folly::join(
"; ", crumbs.begin(), crumbs.end(), retval);
29 bool allValuesPresent =
true;
30 bool verifyCookies =
false;
35 return (value1 == value2);
41 DCHECK(h2HasValue) <<
"h2 does not contain name=" << name
42 <<
" value=" << value1;
43 allValuesPresent &= h2HasValue;
56 for (i = 0; i < 2; ++
i) {
57 std::vector<std::string> crumbs;
60 crumbs.push_back(crumb);
63 cookies[
i] = combineCookieCrumbsSorted(crumbs);
65 if (cookies[0] == cookies[1]) {
66 LOG(INFO) <<
"Cookie crumbs are reordered";
68 LOG(INFO) <<
"Cookies are not equal: `" << cookies[0] <<
"' vs. `" 74 return allValuesPresent;
85 std::vector<string>& cookies) {
86 std::vector<compress::Header> allHeaders;
96 allHeaders.emplace_back(
104 allHeaders.emplace_back(
113 vector<folly::StringPiece> cookiePieces;
115 cookies.reserve(cookies.size() + cookiePieces.size());
116 for (
auto cookie : cookiePieces) {
118 allHeaders.emplace_back(code, name, cookies.back());
124 allHeaders.emplace_back(code, name, value);
StringPiece ltrimWhitespace(StringPiece sp)
bool operator==(const HTTPMessage &msg1, const HTTPMessage &msg2)
std::vector< compress::Header > prepareMessageForCompression(const HTTPMessage &msg, std::vector< string > &cookies)
void split(const Delim &delimiter, const String &input, std::vector< OutputType > &out, bool ignoreEmpty)
static const char *const value
HTTPHeaders & getHeaders()
const std::string & getMethodString() const
void join(const Delim &delimiter, Iterator begin, Iterator end, String &output)
folly::Optional< HTTPMethod > getMethod() const
const std::string & getURL() const