-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
quiche: handle multiple cookies and multiple set-cookie headers #14969
Changes from 3 commits
53fbef6
a80c27f
57e94af
f0d1aad
e9349a1
d1be519
ed80087
b0a0281
ca245c9
d432876
6b34146
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,8 +42,17 @@ template <class T> | |
std::unique_ptr<T> quicHeadersToEnvoyHeaders(const quic::QuicHeaderList& header_list) { | ||
auto headers = T::create(); | ||
for (const auto& entry : header_list) { | ||
// TODO(danzh): Avoid copy by referencing entry as header_list is already validated by QUIC. | ||
headers->addCopy(Http::LowerCaseString(entry.first), entry.second); | ||
auto key = Http::LowerCaseString(entry.first); | ||
if (!Runtime::runtimeFeatureEnabled( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW I don't think you need to runtime guard QUIC code if youdon't want to as it's still alpha There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good point! Removed the runtime guard here but still checks it in tests. |
||
"envoy.reloadable_features.header_map_coalesce_cookie_headers") || | ||
key != Http::Headers::get().Cookie) { | ||
// TODO(danzh): Avoid copy by referencing entry as header_list is already validated by QUIC. | ||
headers->addCopy(key, entry.second); | ||
} else { | ||
// QUICHE breaks "cookie" header into crumbs. Coalesce them by appending current one to | ||
// existing one if there is any. | ||
headers->appendCopy(key, entry.second); | ||
} | ||
} | ||
return headers; | ||
} | ||
|
@@ -54,8 +63,7 @@ std::unique_ptr<T> spdyHeaderBlockToEnvoyHeaders(const spdy::SpdyHeaderBlock& he | |
for (auto entry : header_block) { | ||
// TODO(danzh): Avoid temporary strings and addCopy() with string_view. | ||
std::string key(entry.first); | ||
std::string value(entry.second); | ||
headers->addCopy(Http::LowerCaseString(key), value); | ||
headers->addCopy(Http::LowerCaseString(key), entry.second); | ||
} | ||
return headers; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will result in cookies coalescing, but in correctly coalescing cookies. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed it!