diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2020-09-04 06:43:20 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-04 06:43:20 -0400 |
commit | a10339cb209ddb34348a9a3cc78f7319d4c8c6dc (patch) | |
tree | 9bb20f1698c58b9f5be708945602a7128cc57e1f /test_util/src | |
parent | 2b43ce65ae3be66ac4a1c28b18f797690eed701e (diff) |
fix: Handle bad redirects more gracefully (#7342)
Diffstat (limited to 'test_util/src')
-rw-r--r-- | test_util/src/lib.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs index 84e353a8b..1f8548e34 100644 --- a/test_util/src/lib.rs +++ b/test_util/src/lib.rs @@ -264,6 +264,11 @@ pub async fn run_all_servers() { ); Box::new(res) }); + let bad_redirect = warp::path("bad_redirect").map(|| -> Box<dyn Reply> { + let mut res = Response::new(Body::from("")); + *res.status_mut() = StatusCode::FOUND; + Box::new(res) + }); let etag_script = warp::path!("etag_script.ts") .and(warp::header::optional::<String>("if-none-match")) @@ -404,7 +409,8 @@ pub async fn run_all_servers() { .or(xtypescripttypes) .or(echo_server) .or(echo_multipart_file) - .or(multipart_form_data); + .or(multipart_form_data) + .or(bad_redirect); let http_fut = warp::serve(content_type_handler.clone()).bind(([127, 0, 0, 1], PORT)); |