Method: Aliyun::OSS::HTTP#get_request_url

Defined in:
lib/aliyun/oss/http.rb

#get_request_url(bucket, object) ⇒ Object



122
123
124
125
126
127
128
129
130
131
132
# File 'lib/aliyun/oss/http.rb', line 122

def get_request_url(bucket, object)
  url = @config.endpoint.dup
  url.query = nil
  url.fragment = nil 
  isIP = !!(url.host =~ Resolv::IPv4::Regex)
  url.host = "#{bucket}." + url.host if bucket && !@config.cname && !isIP
  url.path = '/'
  url.path << "#{bucket}/" if bucket && isIP
  url.path << CGI.escape(object) if object
  url.to_s
end