mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
parse ASCII code * in wildcard domain. Fixes #1093
This commit is contained in:
parent
4ec4aa1e48
commit
d53c31ea34
2 changed files with 11 additions and 3 deletions
|
@ -18,8 +18,10 @@ module Fog
|
|||
def end_element(name)
|
||||
if @section == :resource_record_set
|
||||
case name
|
||||
when 'Name', 'Type', 'TTL', 'SetIdentifier', 'Weight', 'Region'
|
||||
when 'Type', 'TTL', 'SetIdentifier', 'Weight', 'Region'
|
||||
@resource_record_set[name] = value
|
||||
when 'Name'
|
||||
@resource_record_set[name] = value.gsub('\\052', '*')
|
||||
when 'Value'
|
||||
@resource_record_set['ResourceRecords'] << value
|
||||
when 'AliasTarget'
|
||||
|
|
|
@ -22,14 +22,20 @@ Shindo.tests("Fog::DNS[:aws] | records", ['aws', 'dns']) do
|
|||
records << @zone.records.create(:name => "#{i}.#{@zone.domain}", :type => "A", :ttl => 3600, :value => ['1.2.3.4'])
|
||||
end
|
||||
|
||||
tests("#all!").returns(102) do
|
||||
records << @zone.records.create(:name => "*.#{@zone.domain}", :type => "A", :ttl => 3600, :value => ['1.2.3.4'])
|
||||
|
||||
tests("#all!").returns(103) do
|
||||
@zone.records.all!.size
|
||||
end
|
||||
|
||||
tests("#all!").returns(102) do
|
||||
tests("#all!").returns(103) do
|
||||
@zone.records.all!.size
|
||||
end
|
||||
|
||||
tests("#all wildcard parsing").returns(true) do
|
||||
@zone.records.map(&:name).include?("*.#{@zone.domain}")
|
||||
end
|
||||
|
||||
records.each do |record|
|
||||
record.destroy
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue