You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// let value = req.headers().get(header::COOKIE).cloned();
let value: Vec<_> = req
.headers()
.get_all(header::COOKIE)
.iter()
.map(|a| a.to_str().unwrap())
.collect();
let value = value.join("; ");
let value = Some(HeaderValue::from_str(&*value).unwrap());
The text was updated successfully, but these errors were encountered:
I've just checked it, and everything works exactly as you said. On the implementation though, I'd prefer these manipulations to be lazy, to avoid unnecessary allocations for requests without cookies access. Let me know if you'd provide a PR, or I can look into it myself in a few days. Thank you 🙏
I believe this line https://github.com/imbolc/tower-cookies/blob/main/src/service/mod.rs#L39 is only processing the first occurrence of the
Cookie:
header but apparently HTTP2 supports multiple Cookie headers (for better compression) (See https://www.rfc-editor.org/rfc/rfc7540#section-8.1.2.5 ). Both Chrome and Safari seem to be sending them as separate cookie headers.Switching that line https://github.com/imbolc/tower-cookies/blob/main/src/service/mod.rs#L39 out to this hideous block seems to fix it as it just recreates the giant cookie blob and lets the rest split like normal.
The text was updated successfully, but these errors were encountered: