This is an automated email from the ASF dual-hosted git repository.

gxd pushed a commit to branch fix_binding_java
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git


The following commit(s) were added to refs/heads/fix_binding_java by this push:
     new e95d3dcbc test(binding/java): skip content-length header
e95d3dcbc is described below

commit e95d3dcbcf1e6aca8f01eaea1e26e965ab93d880
Author: G-XD <[email protected]>
AuthorDate: Wed Nov 1 00:38:27 2023 +0800

    test(binding/java): skip content-length header
---
 .../test/java/org/apache/opendal/test/behavior/AsyncPresignTest.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git 
a/bindings/java/src/test/java/org/apache/opendal/test/behavior/AsyncPresignTest.java
 
b/bindings/java/src/test/java/org/apache/opendal/test/behavior/AsyncPresignTest.java
index 52bf27dc6..05b129b59 100644
--- 
a/bindings/java/src/test/java/org/apache/opendal/test/behavior/AsyncPresignTest.java
+++ 
b/bindings/java/src/test/java/org/apache/opendal/test/behavior/AsyncPresignTest.java
@@ -129,6 +129,11 @@ public class AsyncPresignTest extends BehaviorTestBase {
         final ClassicRequestBuilder builder =
                 
ClassicRequestBuilder.create(signedReq.getMethod()).setUri(signedReq.getUri());
         for (Map.Entry<String, String> entry : 
signedReq.getHeaders().entrySet()) {
+            // Skip content-length header, which is auto set by the http 
client.
+            // If the header is set, the request will throw exception: 
Content-Length header already present.
+            if (HttpHeaders.CONTENT_LENGTH.equalsIgnoreCase(entry.getKey())) {
+                continue;
+            }
             builder.addHeader(entry.getKey(), entry.getValue());
         }
         return builder;

Reply via email to