aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Efimov <xeno@prnwatch.com>2022-06-16 14:13:31 +0300
committerAlexey Efimov <xeno@prnwatch.com>2022-06-16 14:13:31 +0300
commitc0fe73f947f62476b336002f7fa85301f8a80dee (patch)
tree496bfd4726adb668180f27f58171ff0ad3e677e8
parentb6cbf7994aced152d09f4583e6e7f5d72f7f71da (diff)
downloadydb-c0fe73f947f62476b336002f7fa85301f8a80dee.tar.gz
fix url redirects KIKIMR-14742
ref:bc48d7b2310f0650d8942a10386153ee836a6fa7
-rw-r--r--ydb/core/mon/async_http_mon.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/ydb/core/mon/async_http_mon.cpp b/ydb/core/mon/async_http_mon.cpp
index 99fd92134a..ce0818a179 100644
--- a/ydb/core/mon/async_http_mon.cpp
+++ b/ydb/core/mon/async_http_mon.cpp
@@ -425,7 +425,12 @@ public:
}
if (index) {
TStringBuilder response;
- response << "HTTP/1.1 302 Found\r\nLocation: " << url + "/" << "\r\n\r\n";
+ auto p = url.rfind('/');
+ if (p != TString::npos) {
+ url = url.substr(p + 1);
+ }
+ url += '/';
+ response << "HTTP/1.1 302 Found\r\nLocation: " << url << "\r\n\r\n";
Send(ev->Sender, new NHttp::TEvHttpProxy::TEvHttpOutgoingResponse(ev->Get()->Request->CreateResponseString(response)));
return;
}