From 88a4f04217a3f7a36eef911a2fbdf09dc51566fe Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sun, 10 Jan 2016 16:52:04 -0800 Subject: [PATCH] Bucket host should include port and not path This resolves issues when using v4 signing with path-style requests. --- src/curl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/curl.cpp b/src/curl.cpp index fe7ab9e..e41cc09 100644 --- a/src/curl.cpp +++ b/src/curl.cpp @@ -111,7 +111,7 @@ static string url_to_host(const std::string &url) } size_t idx; - if ((idx = host.find(':')) != string::npos || (idx = host.find('/')) != string::npos) { + if ((idx = host.find('/')) != string::npos) { return host.substr(0, idx); } else { return host; @@ -123,7 +123,7 @@ static string get_bucket_host() if(!pathrequeststyle){ return bucket + "." + url_to_host(host); } - return url_to_host(host) + "/" + bucket; + return url_to_host(host); } #if 0 // noused