Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

make originHTTPPort and originHTTPSPort optional

  • Loading branch information...
commit c5f569d2e114d75929a0607a7a770ce6faae76b9 1 parent 41f5d51
Christian Tellnes authored
Showing with 15 additions and 6 deletions.
  1. +15 −6 lib/index.js
21 lib/index.js
View
@@ -217,10 +217,14 @@ CloudFront.prototype.generateDistributionXml = function(config) {
} else if (config.originType == 'custom') {
data.CustomOrigin = {
DNSName: config.originDNSName,
- HTTPPort: config.originHTTPPort,
- HTTPSPort: config.originHTTPSPort,
OriginProtocolPolicy: config.originProtocolPolicy
};
+ if (config.originHTTPPort) {
+ data.CustomOrigin.HTTPPort = config.originHTTPPort;
+ }
+ if (config.originHTTPSPort) {
+ data.CustomOrigin.HTTPSPort = config.originHTTPSPort;
+ }
}
if (config.logging) {
data.Logging = {
@@ -251,11 +255,12 @@ CloudFront.prototype.generateDistributionXml = function(config) {
return data2xml('DistributionConfig', data);
};
-CloudFront.prototype.createDistribution = function(config, callerReference, cb) {
+CloudFront.prototype.createDistribution = function(callerReference, config, cb) {
if (arguments.length === 3) {
config.callerReference = callerReference;
} else {
- cb = callerReference;
+ cb = config;
+ config = callerReference;
}
config.cb = cb;
@@ -569,8 +574,12 @@ CloudFront.prototype.getPrivateUrl = function(a, b, c, d) {
};
-CloudFront.prototype.createStreamingDistribution = function(config, callerReference, cb) {
- config.streaming = true;
+CloudFront.prototype.createStreamingDistribution = function(a, b) {
+ if (arguments.length === 3) {
+ b.streaming = true;
+ } else {
+ a.streaming = true;
+ }
this.createDistribution.apply(this, arguments);
};
Please sign in to comment.
Something went wrong with that request. Please try again.