summaryrefslogtreecommitdiff
path: root/test_util
diff options
context:
space:
mode:
Diffstat (limited to 'test_util')
-rw-r--r--test_util/src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs
index 4ad6f1c3c..79afdde12 100644
--- a/test_util/src/lib.rs
+++ b/test_util/src/lib.rs
@@ -912,6 +912,13 @@ async fn main_server(
);
Ok(res)
}
+ (_, "/echo_accept") => {
+ let accept = req.headers().get("accept").map(|v| v.to_str().unwrap());
+ let res = Response::new(Body::from(
+ serde_json::json!({ "accept": accept }).to_string(),
+ ));
+ Ok(res)
+ }
_ => {
let mut file_path = testdata_path();
file_path.push(&req.uri().path()[1..]);