fix(web_server): Handle extracting session_token from multiple cookies (#4271)
Replaces `headers().get("cookie)` with `headers().get_all("cookie")`
because Axum splits a single `Cookie: a; b; c` into 3 separate headers
each with a single value
This commit is contained in:
parent
25a684e094
commit
f391a73731
1 changed files with 1 additions and 1 deletions
|
|
@ -46,7 +46,7 @@ pub fn should_use_https(
|
|||
pub fn parse_cookies<T>(request: &Request<T>) -> HashMap<String, String> {
|
||||
let mut cookies = HashMap::new();
|
||||
|
||||
if let Some(cookie_header) = request.headers().get("cookie") {
|
||||
for cookie_header in request.headers().get_all("cookie") {
|
||||
if let Ok(cookie_str) = cookie_header.to_str() {
|
||||
for cookie_part in cookie_str.split(';') {
|
||||
if let Ok(cookie) = Cookie::parse(cookie_part.trim()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue