File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -777,6 +777,12 @@ impl TestFrontend {
777
777
self . client . request ( Method :: GET , url)
778
778
}
779
779
780
+ pub ( crate ) fn post ( & self , url : & str ) -> RequestBuilder {
781
+ let url = self . build_url ( url) ;
782
+ debug ! ( "posting {url}" ) ;
783
+ self . client . request ( Method :: POST , url)
784
+ }
785
+
780
786
pub ( crate ) fn get_no_redirect ( & self , url : & str ) -> RequestBuilder {
781
787
let url = self . build_url ( url) ;
782
788
debug ! ( "getting {url} (no redirects)" ) ;
Original file line number Diff line number Diff line change @@ -572,7 +572,7 @@ where
572
572
fn axum_cached_redirect < U > (
573
573
uri : U ,
574
574
cache_policy : cache:: CachePolicy ,
575
- ) -> Result < impl IntoResponse , Error >
575
+ ) -> Result < axum :: response :: Response , Error >
576
576
where
577
577
U : TryInto < http:: Uri > + std:: fmt:: Debug ,
578
578
<U as TryInto < http:: Uri > >:: Error : std:: fmt:: Debug ,
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ use axum::{
6
6
handler:: Handler as AxumHandler ,
7
7
middleware:: { self , Next } ,
8
8
response:: { IntoResponse , Redirect } ,
9
- routing:: { get, MethodRouter } ,
9
+ routing:: { get, post , MethodRouter } ,
10
10
Router as AxumRouter ,
11
11
} ;
12
12
use axum_extra:: routing:: RouterExt ;
39
39
} ) )
40
40
}
41
41
42
+ #[ instrument( skip_all) ]
43
+ fn post_internal < H , T , S > ( handler : H ) -> MethodRouter < S , Infallible >
44
+ where
45
+ H : AxumHandler < T , S > ,
46
+ T : ' static ,
47
+ S : Clone + Send + Sync + ' static ,
48
+ {
49
+ post ( handler) . route_layer ( middleware:: from_fn ( |request, next| async {
50
+ request_recorder ( request, next, None ) . await
51
+ } ) )
52
+ }
53
+
42
54
#[ instrument( skip_all) ]
43
55
fn get_rustdoc < H , T , S > ( handler : H ) -> MethodRouter < S , Infallible >
44
56
where
You can’t perform that action at this time.
0 commit comments