From 9420d24c21b4e06d62f356637599c6ec8e7e3e4d Mon Sep 17 00:00:00 2001 From: Ruifeng Yang <149233652@qq.com> Date: Sat, 1 Aug 2015 17:39:17 +0800 Subject: [PATCH] rgw:the arguments 'domain' should not be assigned when return false Hostnames: [B.A] Inputs: [X.BB.A] Return: [false] Output: [B.A] it is wrong. Fixes: #12629 Signed-off-by: Ruifeng Yang <149233652@qq.com> --- src/rgw/rgw_rest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index a03e31fabf2e..e5b0c8158619 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -232,8 +232,8 @@ static bool rgw_find_host_in_domains(const string& host, string *domain, string if (!str_ends_with(host, *iter, &pos)) continue; - *domain = host.substr(pos); if (pos == 0) { + *domain = host; subdomain->clear(); } else { if (host[pos - 1] != '.') { -- 2.47.3