Skip to content

Commit eb720cc

Browse files
author
neil
committed
updating deps
1 parent b910a0f commit eb720cc

File tree

2 files changed

+17
-22
lines changed

2 files changed

+17
-22
lines changed

Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[package]
22
name = "autodiscover"
3-
version = "0.1.0"
4-
edition = "2018"
3+
version = "0.2.0"
4+
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
99
lazy_static = "1.4"
1010
toml = "0.5"
11-
actix-web = "2.0"
12-
actix-rt = "1.0"
13-
askama = "0.9"
11+
actix-web = "4.0.0-rc.3"
12+
actix-rt = "2.6"
13+
askama = "0.11"
1414
serde = "1.0"
1515
serde_derive = "1.0"
16-
quick-xml = "0.18.1"
16+
quick-xml = "0.22"
1717
uuid = { version = "0.8", features = ["v4"] }

src/handlers.rs

+11-16
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,30 @@ pub async fn autoconfig(getdata: web::Query<HashMap<String, String>>) -> Result<
1818
);
1919
}
2020

21-
HttpResponse::Ok().content_type("text/xml").body(tpl).await
21+
Ok(HttpResponse::Ok().content_type("text/xml").body(tpl))
2222
}
2323

2424
pub async fn autodiscover_json() -> Result<HttpResponse> {
25-
HttpResponse::Ok()
25+
Ok(HttpResponse::Ok()
2626
.content_type("application/json")
2727
.body(
2828
AutoDiscoverJson { c: &CONFIG }
2929
.render()
3030
.expect("Failed to render template"),
31-
)
32-
.await
31+
))
3332
}
3433

3534
pub async fn mobileconfig(getdata: web::Query<HashMap<String, String>>) -> Result<HttpResponse> {
3635
let email = get_email_address(None, getdata.into_inner());
3736

38-
HttpResponse::Ok()
37+
Ok(HttpResponse::Ok()
3938
.content_type("application/x-apple-aspen-config; charset=utf-8")
40-
.header(
39+
.insert_header((
4140
http::header::CONTENT_DISPOSITION,
4241
format!(
4342
"attachment; filename={}.mobileconfig",
4443
&CONFIG.general.domain
45-
),
44+
))
4645
)
4746
.body(
4847
MobileConfigXml {
@@ -53,8 +52,7 @@ pub async fn mobileconfig(getdata: web::Query<HashMap<String, String>>) -> Resul
5352
}
5453
.render()
5554
.expect("Failed to render template"),
56-
)
57-
.await
55+
))
5856
}
5957

6058
pub async fn autodiscover_xml_get(
@@ -63,7 +61,7 @@ pub async fn autodiscover_xml_get(
6361
let schema = get_schema(None);
6462
let email = get_email_address(None, getdata.into_inner());
6563

66-
HttpResponse::Ok()
64+
Ok(HttpResponse::Ok()
6765
.content_type("text/xml")
6866
.body(
6967
AutoDiscoverXml {
@@ -73,22 +71,20 @@ pub async fn autodiscover_xml_get(
7371
}
7472
.render()
7573
.expect("Failed to render template"),
76-
)
77-
.await
74+
))
7875
}
7976

8077
pub async fn autodiscover_xml_post(
8178
raw_post: web::Bytes,
8279
getdata: web::Query<HashMap<String, String>>,
83-
req: web::HttpRequest,
8480
) -> Result<HttpResponse> {
8581

8682
let xml_post = read_xml(raw_post);
8783

8884
let schema = get_schema(Some(xml_post.clone()));
8985
let email = get_email_address(Some(xml_post), getdata.into_inner());
9086

91-
HttpResponse::Ok()
87+
Ok(HttpResponse::Ok()
9288
.content_type("text/xml")
9389
.body(
9490
AutoDiscoverXml {
@@ -98,6 +94,5 @@ pub async fn autodiscover_xml_post(
9894
}
9995
.render()
10096
.expect("Failed to render template"),
101-
)
102-
.await
97+
))
10398
}

0 commit comments

Comments
 (0)