11
11
#include < ydb/core/ymq/base/helpers.h>
12
12
#include < ydb/core/ymq/base/limits.h>
13
13
#include < ydb/core/ymq/base/secure_protobuf_printer.h>
14
+ #include < ydb/core/ymq/base/utils.h>
14
15
15
16
#include < ydb/library/actors/core/actorsystem.h>
16
17
#include < ydb/library/actors/core/log.h>
28
29
#include < util/string/split.h>
29
30
#include < library/cpp/string_utils/url/url.h>
30
31
32
+
31
33
namespace NKikimr ::NSQS {
32
34
33
35
using NKikimrClient::TSqsRequest;
@@ -277,14 +279,6 @@ TString THttpRequest::GetRequestPathPart(TStringBuf path, size_t partIdx) const
277
279
return TString ();
278
280
}
279
281
280
- TString THttpRequest::ExtractQueueNameFromPath (const TStringBuf path) {
281
- return GetRequestPathPart (path, 2 );
282
- }
283
-
284
- TString THttpRequest::ExtractAccountNameFromPath (const TStringBuf path) {
285
- return GetRequestPathPart (path, 1 );
286
- }
287
-
288
282
void THttpRequest::ExtractQueueAndAccountNames (const TStringBuf path) {
289
283
if (Action_ == EAction::ModifyPermissions)
290
284
return ;
@@ -296,9 +290,11 @@ void THttpRequest::ExtractQueueAndAccountNames(const TStringBuf path) {
296
290
297
291
QueueName_ = *QueryParams_.QueueName ;
298
292
} else {
299
- const auto pathAndQuery = QueryParams_.QueueUrl ? GetPathAndQuery (*QueryParams_.QueueUrl ) : GetPathAndQuery (path);
300
- QueueName_ = ExtractQueueNameFromPath (pathAndQuery);
301
- AccountName_ = ExtractAccountNameFromPath (pathAndQuery);
293
+ const auto pathAndQuery = QueryParams_.QueueUrl
294
+ ? GetPathAndQuery (*QueryParams_.QueueUrl )
295
+ : GetPathAndQuery (path);
296
+ QueueName_ = NKikimr::NSQS::ExtractQueueNameFromPath (pathAndQuery, IsPrivateRequest_);
297
+ AccountName_ = NKikimr::NSQS::ExtractAccountNameFromPath (pathAndQuery, IsPrivateRequest_);
302
298
303
299
if (IsProxyAction (Action_)) {
304
300
if (QueryParams_.QueueUrl && *QueryParams_.QueueUrl ) {
@@ -381,9 +377,7 @@ void THttpRequest::ParseCgiParameters(const TCgiParameters& params) {
381
377
}
382
378
383
379
void THttpRequest::ParsePrivateRequestPathPrefix (const TStringBuf& path) {
384
- if (path.StartsWith (PRIVATE_REQUEST_PATH_PREFIX)) {
385
- IsPrivateRequest_ = true ;
386
- }
380
+ IsPrivateRequest_ = NKikimr::NSQS::IsPrivateRequest (path);
387
381
}
388
382
389
383
ui64 THttpRequest::CalculateRequestSizeInBytes (const THttpInput& input, const ui64 contentLength) const {
0 commit comments