Skip to content

Commit

Permalink
Change some variable name and use operation shape id to represent ope…
Browse files Browse the repository at this point in the history
…ration shape
  • Loading branch information
Tianyi Wang committed Mar 21, 2023
1 parent 38963ce commit 6174ff2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class S3100Continue implements GoIntegration {
private static final String ADD_100Continue_Header = "add100Continue";
private static final String ADD_100Continue_Header_INTERNAL = "Add100Continue";
private static final String Continue_Client_Option = "ContinueHeaderThresholdBytes";
private static final Set<String> Put_Op_Set = new HashSet<>(Arrays.asList("PutObject", "UploadPart"));
private static final Set<String> Put_Op_ShapeId_Set = new HashSet<>(Arrays.asList("com.amazonaws.s3#PutObject", "com.amazonaws.s3#UploadPart"));

/**
* Return true if service is Amazon S3.
Expand Down Expand Up @@ -80,7 +80,7 @@ public List<RuntimeClientPlugin> getClientPlugins() {
return ListUtils.of(
RuntimeClientPlugin.builder()
.operationPredicate((model, service, operation) ->
isS3Service(model, service) && Put_Op_Set.contains(operation.getId().getName())
isS3Service(model, service) && Put_Op_ShapeId_Set.contains(operation.getId().toString())
)
.registerMiddleware(MiddlewareRegistrar.builder()
.resolvedFunction(SymbolUtils.createValueSymbolBuilder(ADD_100Continue_Header).build())
Expand Down
4 changes: 2 additions & 2 deletions service/internal/s3shared/s3100continue.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

const s3100ContinueID = "S3100Continue"
const defaultLimit int64 = 1024 * 1024 * 2
const default100ContinueThresholdBytes int64 = 1024 * 1024 * 2

// Add100Continue add middleware, which adds {Expect: 100-continue} header for s3 client HTTP PUT request larger than 2MB
// or with unknown size streaming bodies, during operation builder step
Expand All @@ -32,7 +32,7 @@ func (m *s3100Continue) HandleBuild(
) (
out middleware.BuildOutput, metadata middleware.Metadata, err error,
) {
sizeLimit := defaultLimit
sizeLimit := default100ContinueThresholdBytes
switch {
case m.continueHeaderThresholdBytes == -1:
return next.HandleBuild(ctx, in)
Expand Down

0 comments on commit 6174ff2

Please sign in to comment.