99x/dynamodb-localhost

Fix dynamo download

LeoFalco opened this issue ยท 0 comments

Hi! ๐Ÿ‘‹

Firstly, thanks for your work on this project! ๐Ÿ™‚

Today I used patch-package to patch dynamodb-localhost@0.0.2 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/dynamodb-localhost/dynamodb/config.json b/node_modules/dynamodb-localhost/dynamodb/config.json
index 857d66f..207799a 100644
--- a/node_modules/dynamodb-localhost/dynamodb/config.json
+++ b/node_modules/dynamodb-localhost/dynamodb/config.json
@@ -1,6 +1,6 @@
 {
     "setup": {
-        "download_url": "http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.tar.gz",
+        "download_url": "https://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.tar.gz",
         "install_path": "/bin",
         "jar": "DynamoDBLocal.jar"
     },
diff --git a/node_modules/dynamodb-localhost/dynamodb/installer.js b/node_modules/dynamodb-localhost/dynamodb/installer.js
index b4c9450..3db2802 100644
--- a/node_modules/dynamodb-localhost/dynamodb/installer.js
+++ b/node_modules/dynamodb-localhost/dynamodb/installer.js
@@ -3,17 +3,17 @@
 var tar = require('tar'),
     zlib = require('zlib'),
     path = require('path'),
-    http = require('http'),
+    https = require('https'),
     fs = require('fs'),
     ProgressBar = require('progress'),
     utils = require('./utils');
 
 var download = function (downloadUrl, installPath, callback) {
-    http.get(downloadUrl, function (response) {
+    https.get(downloadUrl, function (response) {
             if (302 != response.statusCode) {
                 callback(new Error('Error getting DynamoDb local latest tar.gz location: ' + response.statusCode));
             }
-            http.get(response.headers.location, function (redirectResponse) {
+            https.get(response.headers.location, function (redirectResponse) {
                     var len = parseInt(redirectResponse.headers['content-length'], 10),
                         bar = new ProgressBar('Downloading dynamodb-local [:bar] :percent :etas', {
                             complete: '=',

This issue body was partially generated by patch-package.