Skip to content

Commit 6174ff2

Browse files
author
Tianyi Wang
committed
Change some variable name and use operation shape id to represent operation shape
1 parent 38963ce commit 6174ff2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/S3100Continue.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class S3100Continue implements GoIntegration {
2727
private static final String ADD_100Continue_Header = "add100Continue";
2828
private static final String ADD_100Continue_Header_INTERNAL = "Add100Continue";
2929
private static final String Continue_Client_Option = "ContinueHeaderThresholdBytes";
30-
private static final Set<String> Put_Op_Set = new HashSet<>(Arrays.asList("PutObject", "UploadPart"));
30+
private static final Set<String> Put_Op_ShapeId_Set = new HashSet<>(Arrays.asList("com.amazonaws.s3#PutObject", "com.amazonaws.s3#UploadPart"));
3131

3232
/**
3333
* Return true if service is Amazon S3.
@@ -80,7 +80,7 @@ public List<RuntimeClientPlugin> getClientPlugins() {
8080
return ListUtils.of(
8181
RuntimeClientPlugin.builder()
8282
.operationPredicate((model, service, operation) ->
83-
isS3Service(model, service) && Put_Op_Set.contains(operation.getId().getName())
83+
isS3Service(model, service) && Put_Op_ShapeId_Set.contains(operation.getId().toString())
8484
)
8585
.registerMiddleware(MiddlewareRegistrar.builder()
8686
.resolvedFunction(SymbolUtils.createValueSymbolBuilder(ADD_100Continue_Header).build())

service/internal/s3shared/s3100continue.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
const s3100ContinueID = "S3100Continue"
11-
const defaultLimit int64 = 1024 * 1024 * 2
11+
const default100ContinueThresholdBytes int64 = 1024 * 1024 * 2
1212

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

0 commit comments

Comments
 (0)