mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-30 03:52:50 +03:00
fix: allow :
, .
in SSDs in auth cookie
This commit is contained in:
parent
41714aad7b
commit
f602811a03
@ -376,10 +376,12 @@ async fn login_handler(
|
||||
let cookie = match info.subdomain.unwrap_or_default().as_str() {
|
||||
"" => format!("kinode-auth_{our}={token};"),
|
||||
subdomain => {
|
||||
// enforce that subdomain string only contains a-z, 0-9, and -
|
||||
// enforce that subdomain string only contains a-z, 0-9, ., :, and -
|
||||
let subdomain = subdomain
|
||||
.chars()
|
||||
.filter(|c| c.is_ascii_alphanumeric() || c == &'-')
|
||||
.filter(|c| {
|
||||
c.is_ascii_alphanumeric() || c == &'-' || c == &':' || c == &'.'
|
||||
})
|
||||
.collect::<String>();
|
||||
format!("kinode-auth_{our}@{subdomain}={token};")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user