summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
Diffstat (limited to 'library')
-rw-r--r--library/cpp/grpc/server/grpc_async_ctx_base.h7
-rw-r--r--library/cpp/grpc/server/grpc_request.h6
2 files changed, 11 insertions, 2 deletions
diff --git a/library/cpp/grpc/server/grpc_async_ctx_base.h b/library/cpp/grpc/server/grpc_async_ctx_base.h
index 7b88c072fae..d2461b8b0da 100644
--- a/library/cpp/grpc/server/grpc_async_ctx_base.h
+++ b/library/cpp/grpc/server/grpc_async_ctx_base.h
@@ -2,6 +2,8 @@
#include "grpc_server.h"
+#include <library/cpp/string_utils/quote/quote.h>
+
#include <util/generic/vector.h>
#include <util/generic/string.h>
#include <util/system/yassert.h>
@@ -24,7 +26,10 @@ public:
}
TString GetPeerName() const {
- return Context.peer();
+ // Decode URL-encoded square brackets
+ auto ip = Context.peer();
+ CGIUnescape(ip);
+ return ip;
}
TInstant Deadline() const {
diff --git a/library/cpp/grpc/server/grpc_request.h b/library/cpp/grpc/server/grpc_request.h
index 4e869ef5f6f..d9871f801d7 100644
--- a/library/cpp/grpc/server/grpc_request.h
+++ b/library/cpp/grpc/server/grpc_request.h
@@ -6,6 +6,7 @@
#include <library/cpp/monlib/dynamic_counters/counters.h>
#include <library/cpp/logger/priority.h>
+#include <library/cpp/string_utils/quote/quote.h>
#include "grpc_response.h"
#include "event_callback.h"
@@ -118,7 +119,10 @@ public:
}
TString GetPeer() const override {
- return TString(this->Context.peer());
+ // Decode URL-encoded square brackets
+ auto ip = TString(this->Context.peer());
+ CGIUnescape(ip);
+ return ip;
}
bool SslServer() const override {