summaryrefslogtreecommitdiff
path: root/test_util/src
diff options
context:
space:
mode:
authorMarcos Casagrande <marcoscvp90@gmail.com>2020-07-13 06:53:36 +0200
committerGitHub <noreply@github.com>2020-07-13 00:53:36 -0400
commit4aeac64ecd82d5953bdb92916248f5f7352be4f4 (patch)
tree902111fada801eafc41141d68d865e1ce0ccafa9 /test_util/src
parentac000341db0c90012a6330f66bd7bebe44c9c872 (diff)
fix(cli/fetch): fix relative redirect (#6715)
Diffstat (limited to 'test_util/src')
-rw-r--r--test_util/src/lib.rs8
1 files changed, 8 insertions, 0 deletions
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
@@ -147,6 +147,14 @@ pub async fn run_all_servers() {
warp::redirect(u)
})
.or(
+ warp::path!("a" / "b" / "c")
+ .and(warp::header::<String>("x-location"))
+ .map(|token: String| {
+ let uri: Uri = token.parse().unwrap();
+ warp::redirect(uri)
+ }),
+ )
+ .or(
warp::any()
.and(warp::path::peek())
.and(warp::fs::dir(root_path()))