Permalink
Browse files

Merge latest from appoxy repo

  • Loading branch information...
1 parent f27c470 commit 28e0d8b006196e234426bba8d54d9e48737f72d5 Rob Kischuk committed Nov 11, 2010
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/acf/right_acf_interface.rb
@@ -216,14 +216,12 @@ def list_streaming_distributions
# :caller_reference => "200809102100536497863003"}
#
def create_distribution(origin, comment='', enabled=true, cnames=[], caller_reference=nil)
- caller_reference ||= generate_call_reference
body = distribution_config_for(origin, comment, enabled, cnames, caller_reference, false)
request_hash = generate_request('POST', 'distribution', body.strip)
merge_headers(request_info(request_hash, AcfDistributionParser.new))
end
def create_streaming_distribution(origin, comment='', enabled=true, cnames=[], caller_reference=nil)
- caller_reference ||= generate_call_reference
body = distribution_config_for(origin, comment, enabled, cnames, caller_reference, true)
request_hash = generate_request('POST', 'streaming-distribution', body.strip)
merge_headers(request_info(request_hash, AcfDistributionParser.new))
@@ -236,6 +234,8 @@ def distribution_config_for(origin, comment='', enabled=true, cnames=[], caller_
unless cnames.blank?
cnames.to_a.each { |cname| cnames_str += "\n <CNAME>#{cname}</CNAME>" }
end
+ caller_reference ||= generate_call_reference
+ root_ob = config[:default_root_object] ? "<DefaultRootObject>#{config[:default_root_object]}</DefaultRootObject>" : ""
body = <<-EOXML
<?xml version="1.0" encoding="UTF-8"?>
<#{rootElement} xmlns=#{xmlns}>
@@ -244,6 +244,7 @@ def distribution_config_for(origin, comment='', enabled=true, cnames=[], caller_
#{cnames_str.lstrip}
<Comment>#{AcfInterface::escape(comment.to_s)}</Comment>
<Enabled>#{enabled}</Enabled>
+ #{root_ob}
</#{rootElement}>
EOXML
end

0 comments on commit 28e0d8b

Please sign in to comment.