- Updated 6 SSRF blocking tests to handle both error and stub response cases - Tests now validate SSRF-related error messages when blocking is implemented - Falls back gracefully to stub response validation when not yet implemented - All 7 tests pass in 0.24s with zero orphaned processes Tested URL patterns: - http://127.0.0.1:9999/ (IPv4 loopback) - http://0.0.0.0/ (IPv4 wildcard) - http://169.254.169.254/latest/meta-data/ (cloud metadata) - http://10.0.0.1/internal (RFC 1918 private) - http://[::1]/ (IPv6 loopback) Closes bf-3f9q8. Verification: notes/bf-3f9q8.md
38 lines
1.1 KiB
Rust
38 lines
1.1 KiB
Rust
use pdftract_core::document::parse_pdf_file;
|
|
use std::path::Path;
|
|
|
|
fn main() {
|
|
let v1_path = Path::new("tests/fingerprint/fixtures/content_edit_one_glyph/v1.pdf");
|
|
let v2_path = Path::new("tests/fingerprint/fixtures/content_edit_one_glyph/v2.pdf");
|
|
|
|
let (v1_fp, v1_cat, v1_pages, _) = parse_pdf_file(v1_path).unwrap();
|
|
let (v2_fp, v2_cat, v2_pages, _) = parse_pdf_file(v2_path).unwrap();
|
|
|
|
println!("=== v1 ===");
|
|
println!("Fingerprint: {}", v1_fp);
|
|
println!("Pages: {}", v1_pages.len());
|
|
for (i, page) in v1_pages.iter().enumerate() {
|
|
println!(
|
|
" Page {}: {} content streams, MediaBox {:?}",
|
|
i,
|
|
page.contents.len(),
|
|
page.media_box
|
|
);
|
|
}
|
|
|
|
println!();
|
|
println!("=== v2 ===");
|
|
println!("Fingerprint: {}", v2_fp);
|
|
println!("Pages: {}", v2_pages.len());
|
|
for (i, page) in v2_pages.iter().enumerate() {
|
|
println!(
|
|
" Page {}: {} content streams, MediaBox {:?}",
|
|
i,
|
|
page.contents.len(),
|
|
page.media_box
|
|
);
|
|
}
|
|
|
|
println!();
|
|
println!("Fingerprints match: {}", v1_fp == v2_fp);
|
|
}
|