Skip to content

Commit 76f83f1

Browse files
authored
fix: throw 3XX redirection as errors explicitly (#1591)
1 parent 9684bf6 commit 76f83f1

File tree

230 files changed

+7882
-7882
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+7882
-7882
lines changed

Diff for: clients/client-accessanalyzer/protocols/Aws_restJson1.ts

+18-18
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ export const deserializeAws_restJson1CreateAnalyzerCommand = async (
645645
output: __HttpResponse,
646646
context: __SerdeContext
647647
): Promise<CreateAnalyzerCommandOutput> => {
648-
if (output.statusCode !== 200 && output.statusCode >= 400) {
648+
if (output.statusCode !== 200 && output.statusCode >= 300) {
649649
return deserializeAws_restJson1CreateAnalyzerCommandError(output, context);
650650
}
651651
const contents: CreateAnalyzerCommandOutput = {
@@ -740,7 +740,7 @@ export const deserializeAws_restJson1CreateArchiveRuleCommand = async (
740740
output: __HttpResponse,
741741
context: __SerdeContext
742742
): Promise<CreateArchiveRuleCommandOutput> => {
743-
if (output.statusCode !== 200 && output.statusCode >= 400) {
743+
if (output.statusCode !== 200 && output.statusCode >= 300) {
744744
return deserializeAws_restJson1CreateArchiveRuleCommandError(output, context);
745745
}
746746
const contents: CreateArchiveRuleCommandOutput = {
@@ -839,7 +839,7 @@ export const deserializeAws_restJson1DeleteAnalyzerCommand = async (
839839
output: __HttpResponse,
840840
context: __SerdeContext
841841
): Promise<DeleteAnalyzerCommandOutput> => {
842-
if (output.statusCode !== 200 && output.statusCode >= 400) {
842+
if (output.statusCode !== 200 && output.statusCode >= 300) {
843843
return deserializeAws_restJson1DeleteAnalyzerCommandError(output, context);
844844
}
845845
const contents: DeleteAnalyzerCommandOutput = {
@@ -922,7 +922,7 @@ export const deserializeAws_restJson1DeleteArchiveRuleCommand = async (
922922
output: __HttpResponse,
923923
context: __SerdeContext
924924
): Promise<DeleteArchiveRuleCommandOutput> => {
925-
if (output.statusCode !== 200 && output.statusCode >= 400) {
925+
if (output.statusCode !== 200 && output.statusCode >= 300) {
926926
return deserializeAws_restJson1DeleteArchiveRuleCommandError(output, context);
927927
}
928928
const contents: DeleteArchiveRuleCommandOutput = {
@@ -1005,7 +1005,7 @@ export const deserializeAws_restJson1GetAnalyzedResourceCommand = async (
10051005
output: __HttpResponse,
10061006
context: __SerdeContext
10071007
): Promise<GetAnalyzedResourceCommandOutput> => {
1008-
if (output.statusCode !== 200 && output.statusCode >= 400) {
1008+
if (output.statusCode !== 200 && output.statusCode >= 300) {
10091009
return deserializeAws_restJson1GetAnalyzedResourceCommandError(output, context);
10101010
}
10111011
const contents: GetAnalyzedResourceCommandOutput = {
@@ -1092,7 +1092,7 @@ export const deserializeAws_restJson1GetAnalyzerCommand = async (
10921092
output: __HttpResponse,
10931093
context: __SerdeContext
10941094
): Promise<GetAnalyzerCommandOutput> => {
1095-
if (output.statusCode !== 200 && output.statusCode >= 400) {
1095+
if (output.statusCode !== 200 && output.statusCode >= 300) {
10961096
return deserializeAws_restJson1GetAnalyzerCommandError(output, context);
10971097
}
10981098
const contents: GetAnalyzerCommandOutput = {
@@ -1179,7 +1179,7 @@ export const deserializeAws_restJson1GetArchiveRuleCommand = async (
11791179
output: __HttpResponse,
11801180
context: __SerdeContext
11811181
): Promise<GetArchiveRuleCommandOutput> => {
1182-
if (output.statusCode !== 200 && output.statusCode >= 400) {
1182+
if (output.statusCode !== 200 && output.statusCode >= 300) {
11831183
return deserializeAws_restJson1GetArchiveRuleCommandError(output, context);
11841184
}
11851185
const contents: GetArchiveRuleCommandOutput = {
@@ -1266,7 +1266,7 @@ export const deserializeAws_restJson1GetFindingCommand = async (
12661266
output: __HttpResponse,
12671267
context: __SerdeContext
12681268
): Promise<GetFindingCommandOutput> => {
1269-
if (output.statusCode !== 200 && output.statusCode >= 400) {
1269+
if (output.statusCode !== 200 && output.statusCode >= 300) {
12701270
return deserializeAws_restJson1GetFindingCommandError(output, context);
12711271
}
12721272
const contents: GetFindingCommandOutput = {
@@ -1353,7 +1353,7 @@ export const deserializeAws_restJson1ListAnalyzedResourcesCommand = async (
13531353
output: __HttpResponse,
13541354
context: __SerdeContext
13551355
): Promise<ListAnalyzedResourcesCommandOutput> => {
1356-
if (output.statusCode !== 200 && output.statusCode >= 400) {
1356+
if (output.statusCode !== 200 && output.statusCode >= 300) {
13571357
return deserializeAws_restJson1ListAnalyzedResourcesCommandError(output, context);
13581358
}
13591359
const contents: ListAnalyzedResourcesCommandOutput = {
@@ -1444,7 +1444,7 @@ export const deserializeAws_restJson1ListAnalyzersCommand = async (
14441444
output: __HttpResponse,
14451445
context: __SerdeContext
14461446
): Promise<ListAnalyzersCommandOutput> => {
1447-
if (output.statusCode !== 200 && output.statusCode >= 400) {
1447+
if (output.statusCode !== 200 && output.statusCode >= 300) {
14481448
return deserializeAws_restJson1ListAnalyzersCommandError(output, context);
14491449
}
14501450
const contents: ListAnalyzersCommandOutput = {
@@ -1527,7 +1527,7 @@ export const deserializeAws_restJson1ListArchiveRulesCommand = async (
15271527
output: __HttpResponse,
15281528
context: __SerdeContext
15291529
): Promise<ListArchiveRulesCommandOutput> => {
1530-
if (output.statusCode !== 200 && output.statusCode >= 400) {
1530+
if (output.statusCode !== 200 && output.statusCode >= 300) {
15311531
return deserializeAws_restJson1ListArchiveRulesCommandError(output, context);
15321532
}
15331533
const contents: ListArchiveRulesCommandOutput = {
@@ -1610,7 +1610,7 @@ export const deserializeAws_restJson1ListFindingsCommand = async (
16101610
output: __HttpResponse,
16111611
context: __SerdeContext
16121612
): Promise<ListFindingsCommandOutput> => {
1613-
if (output.statusCode !== 200 && output.statusCode >= 400) {
1613+
if (output.statusCode !== 200 && output.statusCode >= 300) {
16141614
return deserializeAws_restJson1ListFindingsCommandError(output, context);
16151615
}
16161616
const contents: ListFindingsCommandOutput = {
@@ -1701,7 +1701,7 @@ export const deserializeAws_restJson1ListTagsForResourceCommand = async (
17011701
output: __HttpResponse,
17021702
context: __SerdeContext
17031703
): Promise<ListTagsForResourceCommandOutput> => {
1704-
if (output.statusCode !== 200 && output.statusCode >= 400) {
1704+
if (output.statusCode !== 200 && output.statusCode >= 300) {
17051705
return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
17061706
}
17071707
const contents: ListTagsForResourceCommandOutput = {
@@ -1788,7 +1788,7 @@ export const deserializeAws_restJson1StartResourceScanCommand = async (
17881788
output: __HttpResponse,
17891789
context: __SerdeContext
17901790
): Promise<StartResourceScanCommandOutput> => {
1791-
if (output.statusCode !== 200 && output.statusCode >= 400) {
1791+
if (output.statusCode !== 200 && output.statusCode >= 300) {
17921792
return deserializeAws_restJson1StartResourceScanCommandError(output, context);
17931793
}
17941794
const contents: StartResourceScanCommandOutput = {
@@ -1871,7 +1871,7 @@ export const deserializeAws_restJson1TagResourceCommand = async (
18711871
output: __HttpResponse,
18721872
context: __SerdeContext
18731873
): Promise<TagResourceCommandOutput> => {
1874-
if (output.statusCode !== 200 && output.statusCode >= 400) {
1874+
if (output.statusCode !== 200 && output.statusCode >= 300) {
18751875
return deserializeAws_restJson1TagResourceCommandError(output, context);
18761876
}
18771877
const contents: TagResourceCommandOutput = {
@@ -1954,7 +1954,7 @@ export const deserializeAws_restJson1UntagResourceCommand = async (
19541954
output: __HttpResponse,
19551955
context: __SerdeContext
19561956
): Promise<UntagResourceCommandOutput> => {
1957-
if (output.statusCode !== 200 && output.statusCode >= 400) {
1957+
if (output.statusCode !== 200 && output.statusCode >= 300) {
19581958
return deserializeAws_restJson1UntagResourceCommandError(output, context);
19591959
}
19601960
const contents: UntagResourceCommandOutput = {
@@ -2037,7 +2037,7 @@ export const deserializeAws_restJson1UpdateArchiveRuleCommand = async (
20372037
output: __HttpResponse,
20382038
context: __SerdeContext
20392039
): Promise<UpdateArchiveRuleCommandOutput> => {
2040-
if (output.statusCode !== 200 && output.statusCode >= 400) {
2040+
if (output.statusCode !== 200 && output.statusCode >= 300) {
20412041
return deserializeAws_restJson1UpdateArchiveRuleCommandError(output, context);
20422042
}
20432043
const contents: UpdateArchiveRuleCommandOutput = {
@@ -2120,7 +2120,7 @@ export const deserializeAws_restJson1UpdateFindingsCommand = async (
21202120
output: __HttpResponse,
21212121
context: __SerdeContext
21222122
): Promise<UpdateFindingsCommandOutput> => {
2123-
if (output.statusCode !== 200 && output.statusCode >= 400) {
2123+
if (output.statusCode !== 200 && output.statusCode >= 300) {
21242124
return deserializeAws_restJson1UpdateFindingsCommandError(output, context);
21252125
}
21262126
const contents: UpdateFindingsCommandOutput = {

Diff for: clients/client-acm-pca/protocols/Aws_json1_1.ts

+20-20
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ export const deserializeAws_json1_1CreateCertificateAuthorityCommand = async (
391391
output: __HttpResponse,
392392
context: __SerdeContext
393393
): Promise<CreateCertificateAuthorityCommandOutput> => {
394-
if (output.statusCode >= 400) {
394+
if (output.statusCode >= 300) {
395395
return deserializeAws_json1_1CreateCertificateAuthorityCommandError(output, context);
396396
}
397397
const data: any = await parseBody(output.body, context);
@@ -470,7 +470,7 @@ export const deserializeAws_json1_1CreateCertificateAuthorityAuditReportCommand
470470
output: __HttpResponse,
471471
context: __SerdeContext
472472
): Promise<CreateCertificateAuthorityAuditReportCommandOutput> => {
473-
if (output.statusCode >= 400) {
473+
if (output.statusCode >= 300) {
474474
return deserializeAws_json1_1CreateCertificateAuthorityAuditReportCommandError(output, context);
475475
}
476476
const data: any = await parseBody(output.body, context);
@@ -565,7 +565,7 @@ export const deserializeAws_json1_1CreatePermissionCommand = async (
565565
output: __HttpResponse,
566566
context: __SerdeContext
567567
): Promise<CreatePermissionCommandOutput> => {
568-
if (output.statusCode >= 400) {
568+
if (output.statusCode >= 300) {
569569
return deserializeAws_json1_1CreatePermissionCommandError(output, context);
570570
}
571571
await collectBody(output.body, context);
@@ -657,7 +657,7 @@ export const deserializeAws_json1_1DeleteCertificateAuthorityCommand = async (
657657
output: __HttpResponse,
658658
context: __SerdeContext
659659
): Promise<DeleteCertificateAuthorityCommandOutput> => {
660-
if (output.statusCode >= 400) {
660+
if (output.statusCode >= 300) {
661661
return deserializeAws_json1_1DeleteCertificateAuthorityCommandError(output, context);
662662
}
663663
await collectBody(output.body, context);
@@ -733,7 +733,7 @@ export const deserializeAws_json1_1DeletePermissionCommand = async (
733733
output: __HttpResponse,
734734
context: __SerdeContext
735735
): Promise<DeletePermissionCommandOutput> => {
736-
if (output.statusCode >= 400) {
736+
if (output.statusCode >= 300) {
737737
return deserializeAws_json1_1DeletePermissionCommandError(output, context);
738738
}
739739
await collectBody(output.body, context);
@@ -809,7 +809,7 @@ export const deserializeAws_json1_1DescribeCertificateAuthorityCommand = async (
809809
output: __HttpResponse,
810810
context: __SerdeContext
811811
): Promise<DescribeCertificateAuthorityCommandOutput> => {
812-
if (output.statusCode >= 400) {
812+
if (output.statusCode >= 300) {
813813
return deserializeAws_json1_1DescribeCertificateAuthorityCommandError(output, context);
814814
}
815815
const data: any = await parseBody(output.body, context);
@@ -872,7 +872,7 @@ export const deserializeAws_json1_1DescribeCertificateAuthorityAuditReportComman
872872
output: __HttpResponse,
873873
context: __SerdeContext
874874
): Promise<DescribeCertificateAuthorityAuditReportCommandOutput> => {
875-
if (output.statusCode >= 400) {
875+
if (output.statusCode >= 300) {
876876
return deserializeAws_json1_1DescribeCertificateAuthorityAuditReportCommandError(output, context);
877877
}
878878
const data: any = await parseBody(output.body, context);
@@ -943,7 +943,7 @@ export const deserializeAws_json1_1GetCertificateCommand = async (
943943
output: __HttpResponse,
944944
context: __SerdeContext
945945
): Promise<GetCertificateCommandOutput> => {
946-
if (output.statusCode >= 400) {
946+
if (output.statusCode >= 300) {
947947
return deserializeAws_json1_1GetCertificateCommandError(output, context);
948948
}
949949
const data: any = await parseBody(output.body, context);
@@ -1030,7 +1030,7 @@ export const deserializeAws_json1_1GetCertificateAuthorityCertificateCommand = a
10301030
output: __HttpResponse,
10311031
context: __SerdeContext
10321032
): Promise<GetCertificateAuthorityCertificateCommandOutput> => {
1033-
if (output.statusCode >= 400) {
1033+
if (output.statusCode >= 300) {
10341034
return deserializeAws_json1_1GetCertificateAuthorityCertificateCommandError(output, context);
10351035
}
10361036
const data: any = await parseBody(output.body, context);
@@ -1101,7 +1101,7 @@ export const deserializeAws_json1_1GetCertificateAuthorityCsrCommand = async (
11011101
output: __HttpResponse,
11021102
context: __SerdeContext
11031103
): Promise<GetCertificateAuthorityCsrCommandOutput> => {
1104-
if (output.statusCode >= 400) {
1104+
if (output.statusCode >= 300) {
11051105
return deserializeAws_json1_1GetCertificateAuthorityCsrCommandError(output, context);
11061106
}
11071107
const data: any = await parseBody(output.body, context);
@@ -1188,7 +1188,7 @@ export const deserializeAws_json1_1ImportCertificateAuthorityCertificateCommand
11881188
output: __HttpResponse,
11891189
context: __SerdeContext
11901190
): Promise<ImportCertificateAuthorityCertificateCommandOutput> => {
1191-
if (output.statusCode >= 400) {
1191+
if (output.statusCode >= 300) {
11921192
return deserializeAws_json1_1ImportCertificateAuthorityCertificateCommandError(output, context);
11931193
}
11941194
await collectBody(output.body, context);
@@ -1304,7 +1304,7 @@ export const deserializeAws_json1_1IssueCertificateCommand = async (
13041304
output: __HttpResponse,
13051305
context: __SerdeContext
13061306
): Promise<IssueCertificateCommandOutput> => {
1307-
if (output.statusCode >= 400) {
1307+
if (output.statusCode >= 300) {
13081308
return deserializeAws_json1_1IssueCertificateCommandError(output, context);
13091309
}
13101310
const data: any = await parseBody(output.body, context);
@@ -1399,7 +1399,7 @@ export const deserializeAws_json1_1ListCertificateAuthoritiesCommand = async (
13991399
output: __HttpResponse,
14001400
context: __SerdeContext
14011401
): Promise<ListCertificateAuthoritiesCommandOutput> => {
1402-
if (output.statusCode >= 400) {
1402+
if (output.statusCode >= 300) {
14031403
return deserializeAws_json1_1ListCertificateAuthoritiesCommandError(output, context);
14041404
}
14051405
const data: any = await parseBody(output.body, context);
@@ -1454,7 +1454,7 @@ export const deserializeAws_json1_1ListPermissionsCommand = async (
14541454
output: __HttpResponse,
14551455
context: __SerdeContext
14561456
): Promise<ListPermissionsCommandOutput> => {
1457-
if (output.statusCode >= 400) {
1457+
if (output.statusCode >= 300) {
14581458
return deserializeAws_json1_1ListPermissionsCommandError(output, context);
14591459
}
14601460
const data: any = await parseBody(output.body, context);
@@ -1541,7 +1541,7 @@ export const deserializeAws_json1_1ListTagsCommand = async (
15411541
output: __HttpResponse,
15421542
context: __SerdeContext
15431543
): Promise<ListTagsCommandOutput> => {
1544-
if (output.statusCode >= 400) {
1544+
if (output.statusCode >= 300) {
15451545
return deserializeAws_json1_1ListTagsCommandError(output, context);
15461546
}
15471547
const data: any = await parseBody(output.body, context);
@@ -1612,7 +1612,7 @@ export const deserializeAws_json1_1RestoreCertificateAuthorityCommand = async (
16121612
output: __HttpResponse,
16131613
context: __SerdeContext
16141614
): Promise<RestoreCertificateAuthorityCommandOutput> => {
1615-
if (output.statusCode >= 400) {
1615+
if (output.statusCode >= 300) {
16161616
return deserializeAws_json1_1RestoreCertificateAuthorityCommandError(output, context);
16171617
}
16181618
await collectBody(output.body, context);
@@ -1680,7 +1680,7 @@ export const deserializeAws_json1_1RevokeCertificateCommand = async (
16801680
output: __HttpResponse,
16811681
context: __SerdeContext
16821682
): Promise<RevokeCertificateCommandOutput> => {
1683-
if (output.statusCode >= 400) {
1683+
if (output.statusCode >= 300) {
16841684
return deserializeAws_json1_1RevokeCertificateCommandError(output, context);
16851685
}
16861686
await collectBody(output.body, context);
@@ -1796,7 +1796,7 @@ export const deserializeAws_json1_1TagCertificateAuthorityCommand = async (
17961796
output: __HttpResponse,
17971797
context: __SerdeContext
17981798
): Promise<TagCertificateAuthorityCommandOutput> => {
1799-
if (output.statusCode >= 400) {
1799+
if (output.statusCode >= 300) {
18001800
return deserializeAws_json1_1TagCertificateAuthorityCommandError(output, context);
18011801
}
18021802
await collectBody(output.body, context);
@@ -1880,7 +1880,7 @@ export const deserializeAws_json1_1UntagCertificateAuthorityCommand = async (
18801880
output: __HttpResponse,
18811881
context: __SerdeContext
18821882
): Promise<UntagCertificateAuthorityCommandOutput> => {
1883-
if (output.statusCode >= 400) {
1883+
if (output.statusCode >= 300) {
18841884
return deserializeAws_json1_1UntagCertificateAuthorityCommandError(output, context);
18851885
}
18861886
await collectBody(output.body, context);
@@ -1956,7 +1956,7 @@ export const deserializeAws_json1_1UpdateCertificateAuthorityCommand = async (
19561956
output: __HttpResponse,
19571957
context: __SerdeContext
19581958
): Promise<UpdateCertificateAuthorityCommandOutput> => {
1959-
if (output.statusCode >= 400) {
1959+
if (output.statusCode >= 300) {
19601960
return deserializeAws_json1_1UpdateCertificateAuthorityCommandError(output, context);
19611961
}
19621962
await collectBody(output.body, context);

0 commit comments

Comments
 (0)