]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw:the arguments 'domain' should not be assigned when return false 5447/head
authorRuifeng Yang <149233652@qq.com>
Sat, 1 Aug 2015 09:39:17 +0000 (17:39 +0800)
committerRuifeng Yang <149233652@qq.com>
Fri, 7 Aug 2015 00:24:03 +0000 (08:24 +0800)
    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

index a03e31fabf2ec243a600d7222b1ec04b8f6503e3..e5b0c8158619359df3e425193962eabb6da95983 100644 (file)
@@ -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] != '.') {