@@ -18,31 +18,30 @@ pub async fn autoconfig(getdata: web::Query<HashMap<String, String>>) -> Result<
18
18
) ;
19
19
}
20
20
21
- HttpResponse :: Ok ( ) . content_type ( "text/xml" ) . body ( tpl) . await
21
+ Ok ( HttpResponse :: Ok ( ) . content_type ( "text/xml" ) . body ( tpl) )
22
22
}
23
23
24
24
pub async fn autodiscover_json ( ) -> Result < HttpResponse > {
25
- HttpResponse :: Ok ( )
25
+ Ok ( HttpResponse :: Ok ( )
26
26
. content_type ( "application/json" )
27
27
. body (
28
28
AutoDiscoverJson { c : & CONFIG }
29
29
. render ( )
30
30
. expect ( "Failed to render template" ) ,
31
- )
32
- . await
31
+ ) )
33
32
}
34
33
35
34
pub async fn mobileconfig ( getdata : web:: Query < HashMap < String , String > > ) -> Result < HttpResponse > {
36
35
let email = get_email_address ( None , getdata. into_inner ( ) ) ;
37
36
38
- HttpResponse :: Ok ( )
37
+ Ok ( HttpResponse :: Ok ( )
39
38
. content_type ( "application/x-apple-aspen-config; charset=utf-8" )
40
- . header (
39
+ . insert_header ( (
41
40
http:: header:: CONTENT_DISPOSITION ,
42
41
format ! (
43
42
"attachment; filename={}.mobileconfig" ,
44
43
& CONFIG . general. domain
45
- ) ,
44
+ ) )
46
45
)
47
46
. body (
48
47
MobileConfigXml {
@@ -53,8 +52,7 @@ pub async fn mobileconfig(getdata: web::Query<HashMap<String, String>>) -> Resul
53
52
}
54
53
. render ( )
55
54
. expect ( "Failed to render template" ) ,
56
- )
57
- . await
55
+ ) )
58
56
}
59
57
60
58
pub async fn autodiscover_xml_get (
@@ -63,7 +61,7 @@ pub async fn autodiscover_xml_get(
63
61
let schema = get_schema ( None ) ;
64
62
let email = get_email_address ( None , getdata. into_inner ( ) ) ;
65
63
66
- HttpResponse :: Ok ( )
64
+ Ok ( HttpResponse :: Ok ( )
67
65
. content_type ( "text/xml" )
68
66
. body (
69
67
AutoDiscoverXml {
@@ -73,22 +71,20 @@ pub async fn autodiscover_xml_get(
73
71
}
74
72
. render ( )
75
73
. expect ( "Failed to render template" ) ,
76
- )
77
- . await
74
+ ) )
78
75
}
79
76
80
77
pub async fn autodiscover_xml_post (
81
78
raw_post : web:: Bytes ,
82
79
getdata : web:: Query < HashMap < String , String > > ,
83
- req : web:: HttpRequest ,
84
80
) -> Result < HttpResponse > {
85
81
86
82
let xml_post = read_xml ( raw_post) ;
87
83
88
84
let schema = get_schema ( Some ( xml_post. clone ( ) ) ) ;
89
85
let email = get_email_address ( Some ( xml_post) , getdata. into_inner ( ) ) ;
90
86
91
- HttpResponse :: Ok ( )
87
+ Ok ( HttpResponse :: Ok ( )
92
88
. content_type ( "text/xml" )
93
89
. body (
94
90
AutoDiscoverXml {
@@ -98,6 +94,5 @@ pub async fn autodiscover_xml_post(
98
94
}
99
95
. render ( )
100
96
. expect ( "Failed to render template" ) ,
101
- )
102
- . await
97
+ ) )
103
98
}
0 commit comments