From 60b2dbe67af4a919df0d1b802c1fe21909c48d4c Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 6 Sep 2019 14:44:59 -0400 Subject: [PATCH] rgw: fix dns name comparison for virtual hosting Fixes: https://tracker.ceph.com/issues/41692 Signed-off-by: Casey Bodley --- src/rgw/rgw_rest.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index bbc232c16e0..a8fe2de62c8 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -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 valid_hostnames_set) +static bool rgw_find_host_in_domains(const string& host, string *domain, string *subdomain, + const set& valid_hostnames_set) { set::iterator iter; /** TODO, Future optimization -- 2.47.3