Skip to content

Commit

Permalink
editoast: allow accents in user name
Browse files Browse the repository at this point in the history
Signed-off-by: Leo Valais <[email protected]>
  • Loading branch information
leovalais committed Dec 9, 2024
1 parent 8f6131e commit 7282edc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions editoast/src/views/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub mod work_schedules;
#[cfg(test)]
mod test_app;

use ::core::str;
use std::collections::HashSet;
use std::env;
use std::sync::Arc;
Expand Down Expand Up @@ -201,14 +202,12 @@ async fn authenticate(
}
return Ok(Authentication::Unauthenticated);
};
let identity = identity
.to_str()
let identity = str::from_utf8(identity.as_bytes())
.expect("unexpected non-ascii characters in x-remote-user-identity");

let name = match headers.get("x-remote-user-name") {
Some(name) => name
.to_str()
.expect("unexpected non-ascii characters in x-remote-user-name"),
Some(name) => str::from_utf8(name.as_bytes())
.expect("unexpected non-utf8 characters in x-remote-user-name"),
None => "",
};

Expand Down

0 comments on commit 7282edc

Please sign in to comment.