From: Yehuda Sadeh Date: Wed, 2 Nov 2016 18:56:38 +0000 (-0700) Subject: rgw: extract host name from host:port string X-Git-Tag: v11.1.0~123^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1e923567c9833874fb6ceb7343a5df0f8135f995;p=ceph.git rgw: extract host name from host:port string Fixes: http://tracker.ceph.com/issues/17788 Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index 860aed7ded0..66d4fadd9f5 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -1846,6 +1846,10 @@ int RGWREST::preprocess(struct req_state *s, rgw::io::BasicClient* cio) bool s3website_enabled = api_priority_s3website >= 0; if (info.host.size()) { + ssize_t pos = info.host.find(':'); + if (pos >= 0) { + info.host = info.host.substr(0, pos); + } ldout(s->cct, 10) << "host=" << info.host << dendl; string domain; string subdomain;