aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorai3282 <ai3282@yandex-team.com>2023-11-30 13:04:37 +0300
committerai3282 <ai3282@yandex-team.com>2023-11-30 14:08:02 +0300
commita0a9432fa6ffe0a03cb07a06898024529b3f580f (patch)
tree6f9959fe4a38407461f68efd755b4c8b1be551aa
parent6e1e050f4eea195f92f7c5a6ffd9f8e82912f257 (diff)
downloadydb-a0a9432fa6ffe0a03cb07a06898024529b3f580f.tar.gz
fix httpcache error message
-rw-r--r--library/cpp/actors/http/http_cache.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/library/cpp/actors/http/http_cache.cpp b/library/cpp/actors/http/http_cache.cpp
index 343c5203ed..d2856f70c2 100644
--- a/library/cpp/actors/http/http_cache.cpp
+++ b/library/cpp/actors/http/http_cache.cpp
@@ -13,6 +13,10 @@
namespace NHttp {
+static bool StatusSuccess(const TStringBuf& status) {
+ return status.StartsWith("2");
+}
+
class THttpOutgoingCacheActor : public NActors::TActorBootstrapped<THttpOutgoingCacheActor>, THttpConfig {
public:
using TBase = NActors::TActorBootstrapped<THttpOutgoingCacheActor>;
@@ -156,7 +160,7 @@ public:
cacheRecord.Waiters.clear();
TString error;
if (event->Get()->Error.empty()) {
- if (event->Get()->Response != nullptr && event->Get()->Response->Status != "200") {
+ if (event->Get()->Response != nullptr && !StatusSuccess(event->Get()->Response->Status)) {
error = event->Get()->Response->Message;
}
} else {
@@ -449,7 +453,7 @@ public:
if (event->Get()->Response != nullptr) {
status = event->Get()->Response->Status;
- if (!status.StartsWith("2")) {
+ if (!StatusSuccess(status)) {
error = event->Get()->Response->Message;
}
}