mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Add helper method for cdn public ssl url and remove check for hp_cdn_ssl flag.
This commit is contained in:
parent
34dfb733f9
commit
33a0227713
1 changed files with 15 additions and 5 deletions
|
@ -110,11 +110,21 @@ module Fog
|
|||
# return the CDN public url from the appropriate uri from the header
|
||||
begin response = connection.cdn.head_container(key)
|
||||
if response.headers['X-Cdn-Enabled'] == 'True'
|
||||
if connection.hp_cdn_ssl == true
|
||||
response.headers.fetch('X-Cdn-Ssl-Uri', nil)
|
||||
else
|
||||
response.headers.fetch('X-Cdn-Uri', nil)
|
||||
end
|
||||
response.headers.fetch('X-Cdn-Uri', nil)
|
||||
end
|
||||
rescue Fog::CDN::HP::NotFound => err
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def cdn_public_ssl_url
|
||||
requires :key
|
||||
@cdn_public_ssl_url ||= begin
|
||||
# return the CDN public ssl url from the appropriate uri from the header
|
||||
begin response = connection.cdn.head_container(key)
|
||||
if response.headers['X-Cdn-Enabled'] == 'True'
|
||||
response.headers.fetch('X-Cdn-Ssl-Uri', nil)
|
||||
end
|
||||
rescue Fog::CDN::HP::NotFound => err
|
||||
nil
|
||||
|
|
Loading…
Add table
Reference in a new issue