]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw:the arguments 'domain' should not be assigned when return false 5720/head
authorRuifeng Yang <149233652@qq.com>
Sat, 1 Aug 2015 09:39:17 +0000 (17:39 +0800)
committerLoic Dachary <ldachary@redhat.com>
Sun, 30 Aug 2015 13:25:28 +0000 (15:25 +0200)
    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>
(cherry picked from commit 9420d24c21b4e06d62f356637599c6ec8e7e3e4d)

src/rgw/rgw_rest.cc

index d385d6233c72254295f5cb50c7e9b904d9745378..00267b38e1c7304bb39d76398b4b454ff03f971f 100644 (file)
@@ -230,8 +230,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] != '.') {