Skip to content

Commit

Permalink
Publish 0.1.5 to fight fraudulent CVE
Browse files Browse the repository at this point in the history
  • Loading branch information
mmastrac committed May 21, 2024
1 parent 8c8949d commit 99d0469
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "urlnorm"
version = "0.1.3"
version = "0.1.5"
edition = "2021"
description = "A URL normalization library for Rust"
license = "Apache-2.0 OR MIT"
Expand Down
19 changes: 18 additions & 1 deletion benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,22 @@ pub fn normalize_benchmark(c: &mut Criterion) {
});
}

criterion_group!(benches, normalize_benchmark);
pub fn torture_test(c: &mut Criterion) {
let x = std::iter::repeat("A5.html")
.take(50000)
.collect::<String>()
.to_owned();
let mut url_input = "https://goooooooogle.com/hello/index.html/".to_owned();
url_input.push_str(x.as_str());
let url = Url::parse(&url_input).unwrap();

let norm = UrlNormalizer::default();
c.bench_function("normalize url", |b| {
b.iter(|| {
norm.compute_normalization_string(&url);
})
});
}

criterion_group!(benches, normalize_benchmark, torture_test);
criterion_main!(benches);

0 comments on commit 99d0469

Please sign in to comment.