From: Ruifeng Yang <149233652@qq.com> Date: Sat, 1 Aug 2015 09:39:17 +0000 (+0800) Subject: rgw:the arguments 'domain' should not be assigned when return false X-Git-Tag: v9.1.0~388^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9420d24c21b4e06d62f356637599c6ec8e7e3e4d;p=ceph.git 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> --- 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] != '.') {