]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix dns name comparison for virtual hosting 30221/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 6 Sep 2019 18:44:59 +0000 (14:44 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 6 Sep 2019 19:23:27 +0000 (15:23 -0400)
Fixes: https://tracker.ceph.com/issues/41692
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rest.cc

index bbc232c16e0e553121dfc55e5a6d5feb843e412e..a8fe2de62c85501227eeee844bfd93f0a43b5f0a 100644 (file)
@@ -241,10 +241,11 @@ static bool str_ends_with_nocase(const string& s, const string& suffix, size_t *
     *pos = p;
   }
 
-  return boost::algorithm::iends_with(suffix, s);
+  return boost::algorithm::iends_with(s, suffix);
 }
 
-static bool rgw_find_host_in_domains(const string& host, string *domain, string *subdomain, set<string> valid_hostnames_set)
+static bool rgw_find_host_in_domains(const string& host, string *domain, string *subdomain,
+                                     const set<string>& valid_hostnames_set)
 {
   set<string>::iterator iter;
   /** TODO, Future optimization