Skip to content

Commit

Permalink
Merge pull request #846 from aws/fix-route53-customization
Browse files Browse the repository at this point in the history
route53 : fix sanitizeURL customization to handle leading `/`
  • Loading branch information
skotambkar authored Oct 22, 2020
2 parents e113848 + 8397dc1 commit 827ee57
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ protected static GoDependency module(
}

private static final class Versions {
private static final String AWS_SDK = "v0.27.1-0.20201020212433-5fb7a9ec04bb";
private static final String AWS_SDK = "v0.27.1-0.20201021211102-ffda7ace423e";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private AwsCustomGoDependency() {
}

private static final class Versions {
private static final String INTERNAL_S3SHARED = "v0.26.1-0.20201016111247-66b2791dafc4";
private static final String INTERNAL_S3SHARED = "v0.2.1-0.20201019214249-1049b73d5c17";
private static final String INTERNAL_ACCEPTENCODING = "v0.0.0-20200930084954-897dfb99530c";
private static final String INTERNAL_PRESIGNURL = "v0.0.0-20201020212433-5fb7a9ec04bb";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,11 @@ private void writeHostedZoneIDInputSanitizer(
writer.openBlock("case $P :", "", symbolProvider.toSymbol(input), () -> {
writer.addUseImports(SmithyGoDependency.STRINGS);
for (MemberShape member : hostedZoneIDMembers) {
writer.openBlock("if i.$L != nil {", "}", member.getMemberName(), () -> {
writer.write("values := strings.SplitN(*i.$L, \"/\", 2)", member.getMemberName());
writer.write("v := values[len(values)-1]");
writer.write("i.$L = &v", member.getMemberName());
String memberName = member.getMemberName();
writer.openBlock("if i.$L != nil {", "}", memberName, () -> {
writer.write("idx := strings.LastIndex(*i.$L, `/`)", memberName);
writer.write("v := (*i.$L)[idx+1:]", memberName);
writer.write("i.$L = &v", memberName);
});
}
});
Expand Down
198 changes: 99 additions & 99 deletions service/route53/api_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion service/route53/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/aws/aws-sdk-go-v2/service/route53
go 1.15

require (
github.com/aws/aws-sdk-go-v2 v0.27.0
github.com/aws/aws-sdk-go-v2 v0.27.1-0.20201021211102-ffda7ace423e
github.com/awslabs/smithy-go v0.2.0
)

Expand Down
4 changes: 4 additions & 0 deletions service/route53/internal/customizations/sanitizeurl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ func TestSanitizeURLMiddleware(t *testing.T) {
Given: "ABCDEFG",
ExpectedURL: "https://route53.amazonaws.com/2013-04-01/delegationset/ABCDEFG",
},
"includes leading / in hostedzone": {
Given: "/hostedzone/ABCDEFG",
ExpectedURL: "https://route53.amazonaws.com/2013-04-01/delegationset/ABCDEFG",
},
}

for name, c := range cases {
Expand Down

0 comments on commit 827ee57

Please sign in to comment.