We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5511e9a commit 7054131Copy full SHA for 7054131
sentry/src/middleware.rs
@@ -9,6 +9,9 @@ use hyper::{Body, Request};
9
10
use async_trait::async_trait;
11
12
+#[cfg(test)]
13
+pub use test_util::*;
14
+
15
pub mod auth;
16
pub mod campaign;
17
pub mod channel;
@@ -52,3 +55,15 @@ impl<C: Locked + 'static> Chain<C> {
52
55
Ok(request)
53
56
}
54
57
58
59
60
+pub mod test_util {
61
+ use axum::{body::BoxBody, response::Response};
62
63
+ /// Extracts the body as a String from the Response.
64
+ ///
65
+ /// Used when you want to check the response body or debug a response.
66
+ pub async fn body_to_string(response: Response<BoxBody>) -> String {
67
+ String::from_utf8(hyper::body::to_bytes(response).await.unwrap().to_vec()).unwrap()
68
+ }
69
+}
0 commit comments