From 117c86f424c31948c34d58dcc05d38feafc32cfc Mon Sep 17 00:00:00 2001 From: npub16v54tttfqacx9ycvc3k0ut0npj564ahcuajzy6qjvh57ntmsf4uq4806j2 Date: Thu, 11 Jun 2026 18:09:38 -0400 Subject: [PATCH] fix(tests): correct SVG upload test assertion to expect text/xml infer detects XML-based SVG as text/xml (not image/svg+xml), which is not in the blocked list, so the relay accepts it through the generic file path with that MIME type. Co-authored-by: Will Pfleger Signed-off-by: Will Pfleger --- crates/buzz-test-client/tests/e2e_media_extended.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/buzz-test-client/tests/e2e_media_extended.rs b/crates/buzz-test-client/tests/e2e_media_extended.rs index b2a5ceaf2..5b1fc14ce 100644 --- a/crates/buzz-test-client/tests/e2e_media_extended.rs +++ b/crates/buzz-test-client/tests/e2e_media_extended.rs @@ -388,9 +388,9 @@ async fn test_auth_server_tag_correct() { #[tokio::test] #[ignore] -async fn test_upload_svg_accepted_as_octet_stream() { - // SVG with XML declaration has no magic bytes that `infer` recognises, - // so it routes through the generic file path as application/octet-stream. +async fn test_upload_svg_accepted_as_text_xml() { + // SVG with XML declaration is detected by `infer` as text/xml (not image/svg+xml), + // which is not in the blocked list, so it routes through the generic file path. let client = http_client(); let keys = Keys::generate(); let svg = b""; @@ -401,8 +401,8 @@ async fn test_upload_svg_accepted_as_octet_stream() { "SVG (undetected) should succeed via file path, got {status}" ); let desc: serde_json::Value = resp.json().await.unwrap(); - assert_eq!(desc["type"].as_str().unwrap(), "application/octet-stream"); - println!("✅ SVG (XML declaration) → 200 as octet-stream"); + assert_eq!(desc["type"].as_str().unwrap(), "text/xml"); + println!("✅ SVG (XML declaration) → 200 as text/xml"); } #[tokio::test]