From 1e923567c9833874fb6ceb7343a5df0f8135f995 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Wed, 2 Nov 2016 11:56:38 -0700 Subject: [PATCH] rgw: extract host name from host:port string Fixes: http://tracker.ceph.com/issues/17788 Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_rest.cc | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.47.3