forked from Deuxfleurs/tricot
Correct cookie concatenation
This commit is contained in:
parent
d85ef18269
commit
4ba13a3fcb
1 changed files with 3 additions and 3 deletions
|
@ -84,16 +84,16 @@ fn create_proxied_request<B>(
|
|||
}
|
||||
|
||||
// Concatenate cookie headers into single header
|
||||
// (HTTP/2 allows several cookie headers, but we are proxying to
|
||||
// HTTP/1.1 that does not)
|
||||
// (HTTP/2 allows several cookie headers, but we are proxying to HTTP/1.1 that does not)
|
||||
let mut cookie_concat = vec![];
|
||||
while let Some(cookie) = headers.remove(header::COOKIE) {
|
||||
for cookie in headers.get_all(header::COOKIE) {
|
||||
if !cookie_concat.is_empty() {
|
||||
cookie_concat.extend(b"; ");
|
||||
}
|
||||
cookie_concat.extend_from_slice(cookie.as_bytes());
|
||||
}
|
||||
if !cookie_concat.is_empty() {
|
||||
// insert clears the old value of COOKIE and inserts the concatenated version instead
|
||||
headers.insert(header::COOKIE, cookie_concat.try_into()?);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue