token-as-var

This commit is contained in:
Untone 2023-10-18 13:36:28 +03:00
parent 8f236ab0dd
commit ad26023029

View File

@ -32,7 +32,10 @@ async fn connect_handler(
Some(val) => val.to_str().unwrap_or("").split(" ").last().unwrap_or(""),
None => match req.match_info().get("token") {
Some(val) => val,
None => return Err(ErrorUnauthorized("Unauthorized")),
None => match req.query_string().split('=').last() {
Some(val) => val,
None => return Err(ErrorUnauthorized("Unauthorized")),
},
},
};