Skip to content

Commit

Permalink
Fix test on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
stephank committed Dec 23, 2022
1 parent bb83fdd commit 3f6c59a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/static.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,13 @@ async fn redirects_to_sanitized_path() {
assert_eq!(res.status(), StatusCode::MOVED_PERMANENTLY);

let url = res.headers().get(header::LOCATION).unwrap();
assert_eq!(url, "/foo.org/bar/");
// TODO: The request path is apparently parsed differently on Windows, but at least the
// resulting redirect is still safe, and that's the important part.
if cfg!(target_os = "windows") {
assert_eq!(url, "/");
} else {
assert_eq!(url, "/foo.org/bar/");
}
}

#[tokio::test]
Expand Down

0 comments on commit 3f6c59a

Please sign in to comment.