Skip to content

Commit 3f77b66

Browse files
authored
cgi parameters have been sorted YQ-2558 (#619)
1 parent cf1d26d commit 3f77b66

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

ydb/library/yql/providers/s3/actors/yql_s3_applicator_actor.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,19 @@ struct TListMultipartUploads {
8383
}
8484

8585
TString BuildUrl() const {
86+
// We have to sort the cgi parameters for the correct aws signature
87+
// This requirement will be fixed in the curl library
88+
// https://github.com/curl/curl/commit/fc76a24c53b08cdf6eec8ba787d8eac64651d56e
89+
// https://github.com/curl/curl/commit/c87920353883ef9d5aa952e724a8e2589d76add5
8690
TUrlBuilder urlBuilder(Url);
87-
urlBuilder.AddUrlParam("uploads");
88-
urlBuilder.AddUrlParam("prefix", Prefix);
8991
if (KeyMarker) {
9092
urlBuilder.AddUrlParam("key-marker", KeyMarker);
9193
}
94+
urlBuilder.AddUrlParam("prefix", Prefix);
9295
if (UploadIdMarker) {
9396
urlBuilder.AddUrlParam("upload-id-marker", UploadIdMarker);
9497
}
98+
urlBuilder.AddUrlParam("uploads");
9599
return urlBuilder.Build();
96100
}
97101
};
@@ -133,11 +137,15 @@ struct TListParts {
133137
}
134138

135139
TString BuildUrl() const {
140+
// We have to sort the cgi parameters for the correct aws signature
141+
// This requirement will be fixed in the curl library
142+
// https://github.com/curl/curl/commit/fc76a24c53b08cdf6eec8ba787d8eac64651d56e
143+
// https://github.com/curl/curl/commit/c87920353883ef9d5aa952e724a8e2589d76add5
136144
TUrlBuilder urlBuilder(Url);
137-
urlBuilder.AddUrlParam("uploadId", UploadId);
138145
if (PartNumberMarker) {
139146
urlBuilder.AddUrlParam("part-number-marker", PartNumberMarker);
140147
}
148+
urlBuilder.AddUrlParam("uploadId", UploadId);
141149
return urlBuilder.Build();
142150
}
143151
};

ydb/library/yql/providers/s3/object_listers/yql_s3_list.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,18 +287,23 @@ class TS3Lister : public IS3Lister {
287287
private:
288288
static void SubmitRequestIntoGateway(TListingContext& ctx) {
289289
IHTTPGateway::THeaders headers = IHTTPGateway::MakeYcHeaders(ctx.RequestId, ctx.ListingRequest.AuthInfo.GetToken(), {}, ctx.ListingRequest.AuthInfo.GetAwsUserPwd(), ctx.ListingRequest.AuthInfo.GetAwsSigV4());
290-
TUrlBuilder urlBuilder(ctx.ListingRequest.Url);
291-
urlBuilder.AddUrlParam("list-type", "2")
292-
.AddUrlParam("prefix", ctx.ListingRequest.Prefix)
293-
.AddUrlParam("max-keys", TStringBuilder() << ctx.MaxKeys);
294290

291+
// We have to sort the cgi parameters for the correct aws signature
292+
// This requirement will be fixed in the curl library
293+
// https://github.com/curl/curl/commit/fc76a24c53b08cdf6eec8ba787d8eac64651d56e
294+
// https://github.com/curl/curl/commit/c87920353883ef9d5aa952e724a8e2589d76add5
295+
TUrlBuilder urlBuilder(ctx.ListingRequest.Url);
295296
if (ctx.ContinuationToken.Defined()) {
296297
urlBuilder.AddUrlParam("continuation-token", *ctx.ContinuationToken);
297298
}
298299
if (ctx.Delimiter.Defined()) {
299300
urlBuilder.AddUrlParam("delimiter", *ctx.Delimiter);
300301
}
301302

303+
urlBuilder.AddUrlParam("list-type", "2")
304+
.AddUrlParam("max-keys", TStringBuilder() << ctx.MaxKeys)
305+
.AddUrlParam("prefix", ctx.ListingRequest.Prefix);
306+
302307
auto gateway = ctx.GatewayWeak.lock();
303308
if (!gateway) {
304309
ythrow yexception() << "Gateway disappeared";

0 commit comments

Comments
 (0)