If OSS SDK Java try to add usermeta with key name contains '_', the put request will fail.
Example:
com.amazonaws.services.s3.model.ObjectMetadata s3ObjMetadata = new ObjectMetadata();
//s3ObjMetadata.setHeader("x-amz-checksum-crc32c","12341");
s3ObjMetadata.setSSEAlgorithm("AES256");
HashMap<String, String> userMeta = new HashMap<>();
userMeta.put("tmp_test", "18"); // this is the issue
s3ObjMetadata.setUserMetadata(userMeta);
s3ObjMetadata.setContentLength(new File("big.img").length());
//s3ObjMetadata.setSSEAlgorithm("aws:kms");
final PutObjectRequest request = new PutObjectRequest(bucket, "big.img", new File("big.img"))
.withMetadata(s3ObjMetadata);
PutObjectResult putResult = s3Client.putObject(request);
Expected behavior: the put request will succeed.
Actual behavior:
xception in thread "main" com.amazonaws.SdkClientException: Unable to execute HTTP request: Connection or outbound has closed
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleRetryableException(AmazonHttpClient.java:1219)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1165)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:814)
If OSS SDK Java try to add usermeta with key name contains '_', the put request will fail.
Example:
Expected behavior: the put request will succeed.
Actual behavior: xception in thread "main" com.amazonaws.SdkClientException: Unable to execute HTTP request: Connection or outbound has closed at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleRetryableException(AmazonHttpClient.java:1219) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1165) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:814)
This makes OSS not really compatible with AWS S3.