Skip to content
This repository has been archived by the owner on Dec 19, 2017. It is now read-only.

Commit

Permalink
Merge pull request #162 from gyuho/master
Browse files Browse the repository at this point in the history
Fix for Aliasing
  • Loading branch information
armon committed Dec 10, 2014
2 parents 85ef1c6 + 63f5373 commit b2b88cf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions route53/route53.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@ func (r *Route53) query(method, path string, req, resp interface{}) error {
bodyBuf = &newBuf
}

// http://docs.aws.amazon.com/Route53/latest/APIReference/CreateAliasRRSAPI.html
if reflect.Indirect(reflect.ValueOf(req)).Type().Name() == "ChangeResourceRecordSetsRequest" {
for _, change := range req.(ChangeResourceRecordSetsRequest).Changes {
if change.Record.AliasTarget != nil {
replace := change.Record.Type + "</Type><TTL>0</TTL>"
var newBuf bytes.Buffer
newBuf.WriteString(strings.Replace(bodyBuf.String(), replace, change.Record.Type+"</Type>", -1))
bodyBuf = &newBuf
}
}
}

body = bodyBuf
}

Expand Down

0 comments on commit b2b88cf

Please sign in to comment.