From 1d1f00470d2773783b45bbc98dd75b3650fc74de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E6=AD=A3=E8=B6=85?= Date: Sun, 19 Apr 2026 10:11:16 +0800 Subject: [PATCH] test(s3): cover signed equals object reads (#2598) --- crates/e2e_test/src/special_chars_test.rs | 38 +++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/crates/e2e_test/src/special_chars_test.rs b/crates/e2e_test/src/special_chars_test.rs index e6dd33d83..8989b02f3 100644 --- a/crates/e2e_test/src/special_chars_test.rs +++ b/crates/e2e_test/src/special_chars_test.rs @@ -333,6 +333,44 @@ mod tests { Ok(()) } + #[tokio::test] + #[serial] + async fn test_signed_get_existing_object_with_trailing_equals_returns_content() -> Result<(), Box> { + init_logging(); + + let mut env = RustFSTestEnvironment::new().await?; + env.start_rustfs_server(vec![]).await?; + + let client = create_s3_client(&env); + let bucket = "test-existing-equals-key"; + create_bucket(&client, bucket).await?; + + let key = "path/sitemap.xmlage="; + let content = b"object content for raw signed URL with trailing equals"; + client + .put_object() + .bucket(bucket) + .key(key) + .body(ByteStream::from_static(content)) + .send() + .await?; + + let url = format!("{}/{}/{}", env.url, bucket, key); + let response = signed_get(&url, &env.access_key, &env.secret_key).await?; + + assert_eq!( + response.status(), + StatusCode::OK, + "existing object key ending with '=' should pass signature validation and return content" + ); + + let body = response.bytes().await?; + assert_eq!(body.as_ref(), content); + + env.stop_server(); + Ok(()) + } + /// Test DELETE operation with special characters #[tokio::test] #[serial]