lib/fog/aliyun/storage.rb in fog-aliyun-0.3.15 vs lib/fog/aliyun/storage.rb in fog-aliyun-0.3.16

- old
+ new

@@ -124,35 +124,18 @@ def request(params) method = params[:method] time = Time.new.utc date = time.strftime('%a, %d %b %Y %H:%M:%S GMT') - endpoint = params[:endpoint] - location = params[:location] - if endpoint - uri = URI.parse(endpoint) - host = uri.host - path = uri.path - port = uri.port - scheme = uri.scheme - elsif location - host = location + '.aliyuncs.com' - end - - host ||= @host - path ||= @path - port ||= @port - scheme ||= @scheme - bucket = params[:bucket] tmpHost = if bucket - bucket + '.' + host + bucket + '.' + @host else - host + @host end - @connection = Fog::Core::Connection.new("#{scheme}://#{tmpHost}", @persistent, @connection_options) + @connection = Fog::Core::Connection.new("#{@scheme}://#{tmpHost}", @persistent, @connection_options) contentType = params[:contentType] begin headers = '' if params[:headers] @@ -164,10 +147,10 @@ response = @connection.request(params.merge(headers: { 'Content-Type' => contentType, 'Authorization' => 'OSS ' + @aliyun_accesskey_id + ':' + signature, 'Date' => date }.merge!(params[:headers] || {}), - path: "#{path}/#{params[:path]}", + path: "#{@path}/#{params[:path]}", query: params[:query])) rescue Excon::Errors::HTTPStatusError => error raise case error when Excon::Errors::NotFound Fog::Aliyun::Storage::NotFound.slurp(error)