Skip to content

fix: update installer to use https for download #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dynamodb/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"setup": {
"download_url": "http://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz",
"download_url": "https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz",
"install_path": "bin",
"jar": "DynamoDBLocal.jar"
},
Expand Down
4 changes: 2 additions & 2 deletions dynamodb/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var tar = require("tar"),
zlib = require("zlib"),
path = require("path"),
http = require("http"),
https = require("https"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    http = require('http'),
    https = require('https'),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keeps support for http as well as https

fs = require("fs"),
ProgressBar = require("progress"),
utils = require("./utils");
Expand All @@ -12,7 +12,7 @@ var download = function(downloadUrl, installPath, callback) {
console.log(
`Started downloading dynamodb-local from ${downloadUrl} into ${installPath}. Process may take few minutes.`
);
http
https

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    const client = downloadUrl.toLowerCase().startsWith('https') ? https : http;
    client
        .get(downloadUrl, function (response) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.get(downloadUrl, function(response) {
var len = parseInt(response.headers["content-length"], 10),
bar = new ProgressBar(
Expand Down