Skip to content

Commit f384134

Browse files
fruno-bulaxlpil
authored andcommitted
Add test for custom base URLs
1 parent 8b5ccca commit f384134

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/tests.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,3 +1342,17 @@ async fn get_package_release_ok() {
13421342
}
13431343
)
13441344
}
1345+
1346+
#[test]
1347+
fn make_request_base_trailing_slash_is_optional() {
1348+
let slash = http::Uri::from_static("http://host/path/");
1349+
let no_slash = http::Uri::from_static("http://host/path");
1350+
let suffix = "suffix";
1351+
let expect = "/path/suffix";
1352+
1353+
let slash = make_request(slash, http::Method::GET, suffix, None);
1354+
assert_eq!(slash.uri_ref().unwrap().path(), expect);
1355+
1356+
let no_slash = make_request(no_slash, http::Method::GET, suffix, None);
1357+
assert_eq!(no_slash.uri_ref().unwrap().path(), expect);
1358+
}

0 commit comments

Comments
 (0)