1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[rackspace] fix non-SSL public CDN URLs

This commit is contained in:
Sami Samhuri 2013-08-19 16:05:07 -07:00
parent bf7d348d88
commit c73ca4ef21
2 changed files with 20 additions and 1 deletions

View file

@ -77,6 +77,7 @@ module Fog
require 'mime/types'
@rackspace_api_key = options[:rackspace_api_key]
@rackspace_username = options[:rackspace_username]
@rackspace_cdn_ssl = options[:rackspace_cdn_ssl]
end
def data
@ -95,6 +96,10 @@ module Fog
@rackspace_region
end
def ssl?
!!@rackspace_cdn_ssl
end
end
class Real < Fog::Rackspace::Service
@ -134,7 +139,7 @@ module Fog
# @return [Boolean] return true if service is returning SSL-Secured URLs in public_url methods
# @see Directory#public_url
def ssl?
!rackspace_cdn_ssl.nil?
!!rackspace_cdn_ssl
end
# Resets presistent service connections

View file

@ -112,5 +112,19 @@ Shindo.tests('Rackspace | Storage', ['rackspace']) do
pending if Fog.mocking?
Fog::Storage[:rackspace].account
end
tests('ssl') do
tests('ssl enabled') do
@service = Fog::Storage::Rackspace.new(:rackspace_cdn_ssl => true)
returns(true) { @service.ssl? }
end
tests('ssl disabled') do
@service = Fog::Storage::Rackspace.new(:rackspace_cdn_ssl => false)
returns(false) { @service.ssl? }
@service = Fog::Storage::Rackspace.new(:rackspace_cdn_ssl => nil)
returns(false) { @service.ssl? }
end
end
end