From 4aeac64ecd82d5953bdb92916248f5f7352be4f4 Mon Sep 17 00:00:00 2001 From: Marcos Casagrande Date: Mon, 13 Jul 2020 06:53:36 +0200 Subject: fix(cli/fetch): fix relative redirect (#6715) --- test_util/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test_util/src') diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs index 73a1df043..10e803f5f 100644 --- a/test_util/src/lib.rs +++ b/test_util/src/lib.rs @@ -146,6 +146,14 @@ pub async fn run_all_servers() { let u = url.parse::().unwrap(); warp::redirect(u) }) + .or( + warp::path!("a" / "b" / "c") + .and(warp::header::("x-location")) + .map(|token: String| { + let uri: Uri = token.parse().unwrap(); + warp::redirect(uri) + }), + ) .or( warp::any() .and(warp::path::peek()) -- cgit v1.2.3