]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: extract host name from host:port string 11751/head
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 2 Nov 2016 18:56:38 +0000 (11:56 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Wed, 2 Nov 2016 18:56:38 +0000 (11:56 -0700)
Fixes: http://tracker.ceph.com/issues/17788
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rest.cc

index 860aed7ded086cca152954261760c8d70e9c6365..66d4fadd9f58cd4cac62bebebc4ad0508aac3672 100644 (file)
@@ -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;