[storage] don't cgi escape slashes in authed urls
This commit is contained in:
parent
9548c0385b
commit
532bbe31e0
|
@ -28,7 +28,7 @@ module Fog
|
||||||
:headers => {},
|
:headers => {},
|
||||||
:host => @host,
|
:host => @host,
|
||||||
:method => 'GET',
|
:method => 'GET',
|
||||||
:path => [bucket_name, CGI.escape(object_name)].join('/')
|
:path => "#{bucket_name}/#{object_name}"
|
||||||
}, expires)
|
}, expires)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ module Fog
|
||||||
:headers => {},
|
:headers => {},
|
||||||
:host => @host,
|
:host => @host,
|
||||||
:method => 'GET',
|
:method => 'GET',
|
||||||
:path => [bucket_name, CGI.escape(object_name)].join('/')
|
:path => "#{bucket_name}/#{object_name}"
|
||||||
}, expires)
|
}, expires)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ module Fog
|
||||||
:headers => {},
|
:headers => {},
|
||||||
:host => @host,
|
:host => @host,
|
||||||
:method => 'PUT',
|
:method => 'PUT',
|
||||||
:path => [bucket_name, CGI.escape(object_name)].join('/')
|
:path => "#{bucket_name}/#{object_name}"
|
||||||
}, expires)
|
}, expires)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ module Fog
|
||||||
:headers => {},
|
:headers => {},
|
||||||
:host => @host,
|
:host => @host,
|
||||||
:method => 'PUT',
|
:method => 'PUT',
|
||||||
:path => [bucket_name, CGI.escape(object_name)].join('/')
|
:path => "#{bucket_name}/#{object_name}"
|
||||||
}, expires)
|
}, expires)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,8 @@ module Fog
|
||||||
query << "Signature=#{CGI.escape(signature(params))}"
|
query << "Signature=#{CGI.escape(signature(params))}"
|
||||||
query << "Expires=#{params[:headers]['Date']}"
|
query << "Expires=#{params[:headers]['Date']}"
|
||||||
bucket = params[:host].split('.').first
|
bucket = params[:host].split('.').first
|
||||||
"https://#{@host}/#{params[:path]}?#{query.join('&')}"
|
path = CGI.escape(params[:path]).gsub('%2F', '/')
|
||||||
|
"https://#{@host}/#{path}?#{query.join('&')}"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,9 +23,9 @@ module Fog
|
||||||
end
|
end
|
||||||
url({
|
url({
|
||||||
:headers => {},
|
:headers => {},
|
||||||
:host => "#{bucket_name}.#{@host}",
|
:host => @host,
|
||||||
:method => 'GET',
|
:method => 'GET',
|
||||||
:path => CGI.escape(object_name)
|
:path => "#{bucket_name}/#{object_name}"
|
||||||
}, expires)
|
}, expires)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -42,9 +42,9 @@ module Fog
|
||||||
end
|
end
|
||||||
url({
|
url({
|
||||||
:headers => {},
|
:headers => {},
|
||||||
:host => "#{bucket_name}.#{@host}",
|
:host => @host,
|
||||||
:method => 'GET',
|
:method => 'GET',
|
||||||
:path => CGI.escape(object_name)
|
:path => "#{bucket_name}/#{object_name}"
|
||||||
}, expires)
|
}, expires)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,9 @@ module Fog
|
||||||
end
|
end
|
||||||
url({
|
url({
|
||||||
:headers => {},
|
:headers => {},
|
||||||
:host => "#{bucket_name}.#{@host}",
|
:host => @host,
|
||||||
:method => 'PUT',
|
:method => 'PUT',
|
||||||
:path => CGI.escape(object_name)
|
:path => "#{bucket_name}/#{object_name}"
|
||||||
}, expires)
|
}, expires)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -42,9 +42,9 @@ module Fog
|
||||||
end
|
end
|
||||||
url({
|
url({
|
||||||
:headers => {},
|
:headers => {},
|
||||||
:host => "#{bucket_name}.#{@host}",
|
:host => @host,
|
||||||
:method => 'PUT',
|
:method => 'PUT',
|
||||||
:path => CGI.escape(object_name)
|
:path => "#{bucket_name}/#{object_name}"
|
||||||
}, expires)
|
}, expires)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,8 @@ module Fog
|
||||||
query << "GoogleAccessKeyId=#{@google_storage_access_key_id}"
|
query << "GoogleAccessKeyId=#{@google_storage_access_key_id}"
|
||||||
query << "Signature=#{CGI.escape(signature(params))}"
|
query << "Signature=#{CGI.escape(signature(params))}"
|
||||||
query << "Expires=#{params[:headers]['Date']}"
|
query << "Expires=#{params[:headers]['Date']}"
|
||||||
"http://#{params[:host]}/#{params[:path]}?#{query.join('&')}"
|
path = CGI.escape(params[:path]).gsub('%2F', '/')
|
||||||
|
"http://#{params[:host]}/#{path}?#{query.join('&')}"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue