diff options
author | Pritha Srivastava <prsrivas@redhat.com> | 2020-03-29 12:20:32 +0200 |
---|---|---|
committer | Pritha Srivastava <prsrivas@redhat.com> | 2020-06-05 18:01:58 +0200 |
commit | ca96ae806f79063922f27c3b4628026b9930fd89 (patch) | |
tree | 205b4097b5e626b3edf1abf0b4ba3da3b6a9558e /src/rgw/rgw_oidc_provider.cc | |
parent | rgw: adds code to check for client id and cert thumbprint (diff) | |
download | ceph-ca96ae806f79063922f27c3b4628026b9930fd89.tar.xz ceph-ca96ae806f79063922f27c3b4628026b9930fd89.zip |
rgw: adds a commom method to remove prefix(www, http and https)
from a url.
Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
Diffstat (limited to 'src/rgw/rgw_oidc_provider.cc')
-rw-r--r-- | src/rgw/rgw_oidc_provider.cc | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/rgw/rgw_oidc_provider.cc b/src/rgw/rgw_oidc_provider.cc index ee28d2cd162..14eea2f76f8 100644 --- a/src/rgw/rgw_oidc_provider.cc +++ b/src/rgw/rgw_oidc_provider.cc @@ -64,21 +64,7 @@ int RGWOIDCProvider::create(bool exclusive) return -EINVAL; } - string idp_url = provider_url; - auto pos = idp_url.find("http://"); - if (pos == std::string::npos) { - pos = idp_url.find("https://"); - if (pos != std::string::npos) { - idp_url.erase(pos, 8); - } else { - pos = idp_url.find("www."); - if (pos != std::string::npos) { - idp_url.erase(pos, 4); - } - } - } else { - idp_url.erase(pos, 7); - } + string idp_url = url_remove_prefix(provider_url); /* check to see the name is not used */ ret = read_url(idp_url, tenant); |