Skip to content

Is there a way to not use chunked uploading for java-sdk for signature V4?  #580

@harshavardhana

Description

@harshavardhana

PUT /testbbucket/caddy HTTP/1.1 1 1 map[X-Amz-Content-Sha256:[STREAMING-AWS4-HMAC-SHA256-PAYLOAD] User-Agent:[aws-sdk-java/1.10.41 Mac_OS_X/10.11.1 Java_HotSpot(TM)_64-Bit_Server_VM/25.25-b02/1.8.0_25] Content-Type:[application/octet-stream] Content-Length:[12241473] Connection:[Keep-Alive] X-Amz-Date:[20151218T164446Z] X-Amz-Decoded-Content-Length:[12232928] Content-Md5:[4uUkMUjnvb+ymFcDSeexUA==] Authorization:[AWS4-HMAC-SHA256 Credential=WLGDGYAQYIGI833EV05A/20151218/us-east-1/s3/aws4_request, SignedHeaders=content-length;content-md5;content-type;host;user-agent;x-amz-content-sha256;x-amz-date;x-amz-decoded-content-length, Signature=6575c62db878f4151357f54b4e7a5c19555afb1a9efc0573dce615850caaf646]] 0xc82017a140 12241473 [] false localhost:9000 map[] map[] <nil> map[] 127.0.0.1:50544 /testbbucket/caddy <nil> <nil>

Following code makes it default - i couldn't find a way to override this, is there any?

/**
     * Determine whether to use aws-chunked for signing
     */
    private static boolean useChunkEncoding(SignableRequest<?> request) {
        // Whether to use chunked encoding for signing the request
        boolean chunkedEncodingEnabled = false;
        if (request.getOriginalRequestObject() instanceof PutObjectRequest
                || request.getOriginalRequestObject() instanceof UploadPartRequest) {
            chunkedEncodingEnabled = true;
        }
        return chunkedEncodingEnabled;
    }

The behavior is entirely different than how aws-sdk-go behaves which does calculate the sha256 during multipart and regular put operation.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions