Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

route53 : fix sanitizeURL customization to handle leading / #846

Merged
merged 6 commits into from
Oct 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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