Skip to content

Commit

Permalink
add origin propertiese direct to config object
Browse files Browse the repository at this point in the history
  • Loading branch information
tellnes committed Mar 11, 2012
1 parent 862b4ad commit 5d163be
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,19 +232,17 @@ function DistributionConfig(client, info, data) {
CFObject.call(this, client);
this.distribution = info.distribution;

this.origin = {};

if (data.S3Origin) {
this.origin.type = 's3';
this.origin.dnsName = data.S3Origin.DNSName;
this.origin.accessIdentity = data.S3Origin.OriginAccessIdentity;
this.originType = 's3';
this.originDNSName = data.S3Origin.DNSName;
this.originAccessIdentity = data.S3Origin.OriginAccessIdentity;

} else if (data.CustomOrigin) {
this.origin.type = 'custom';
this.origin.dnsName = data.CustomOrigin.DNSName;
this.origin.httpPort = data.CustomOrigin.HTTPPort;
this.origin.httpsPort = data.CustomOrigin.HTTPSPort;
this.origin.protocolPolicy = data.CustomOrigin.OriginProtocolPolicy;
this.originType = 'custom';
this.originDNSName = data.CustomOrigin.DNSName;
this.originHTTPPort = data.CustomOrigin.HTTPPort;
this.originHTTPSPort = data.CustomOrigin.HTTPSPort;
this.originProtocolPolicy = data.CustomOrigin.OriginProtocolPolicy;

}

Expand Down

0 comments on commit 5d163be

Please sign in to comment.