Fix a bug when instance URL included a port

This commit is contained in:
Bat 2018-05-02 14:05:26 +01:00
parent ac1a111d7b
commit 58fad0d414

View File

@ -25,8 +25,7 @@ struct WebfingerQuery {
#[get("/.well-known/webfinger?<query>")] #[get("/.well-known/webfinger?<query>")]
fn webfinger(query: WebfingerQuery, conn: DbConn) -> Content<Result<String, &'static str>> { fn webfinger(query: WebfingerQuery, conn: DbConn) -> Content<Result<String, &'static str>> {
let mut parsed_query = query.resource.split(":"); let mut parsed_query = query.resource.splitn(2, ":");
println!("{:?}", parsed_query.clone().collect::<Vec<&str>>());
let res_type = parsed_query.next().unwrap(); let res_type = parsed_query.next().unwrap();
let res = parsed_query.next().unwrap(); let res = parsed_query.next().unwrap();
if res_type == "acct" { if res_type == "acct" {