aboutsummaryrefslogtreecommitdiff
path: root/src/reverse_proxy.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/reverse_proxy.rs')
-rw-r--r--src/reverse_proxy.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/reverse_proxy.rs b/src/reverse_proxy.rs
index 791b2d5..b5916be 100644
--- a/src/reverse_proxy.rs
+++ b/src/reverse_proxy.rs
@@ -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()?);
}