Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
Fix protocol name comparsion (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mykola Mokhnach committed Feb 21, 2018
1 parent 8fee68a commit 7f3f954
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ async function uploadFile (localPath, remotePath, uploadOptions = {}) {
const {size} = await stat(localPath);
log.info(`Uploading '${localPath}' of ${toReadableSizeString(size)} size to '${remotePath}'...`);
const timeStarted = process.hrtime();
if (remoteUrl.protocol.startsWith('http')) {
if (['http:', 'https:'].includes(remoteUrl.protocol)) {
await uploadFileToHttp(remoteUrl, uploadOptions);
} else if (remoteUrl.protocol === 'ftp') {
} else if (remoteUrl.protocol === 'ftp:') {
await uploadFileToFtp(createReadStream(localPath), remoteUrl, uploadOptions);
} else {
throw new Error(`Cannot upload the file at '${localPath}' to '${remotePath}'. ` +
Expand Down

0 comments on commit 7f3f954

Please sign in to comment.