diff --git a/README.md b/README.md index 9b43be7e..33967f13 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ Evaporate is a JS library for uploading files from a browser to AWS S3, using parallel S3's multipart uploads with MD5 checksum support and control over pausing / resuming the upload. +## This branch allows to use Custom port for S3 endpoint + [![Build Status](https://travis-ci.org/bikeath1337/EvaporateJS.svg?branch=master)](https://travis-ci.org/bikeath1337/EvaporateJS) [![Code Climate](https://codeclimate.com/github/TTLabs/EvaporateJS/badges/gpa.svg)](https://codeclimate.com/github/TTLabs/EvaporateJS) diff --git a/evaporate.js b/evaporate.js index 3a22cd13..ce424880 100644 --- a/evaporate.js +++ b/evaporate.js @@ -1016,7 +1016,17 @@ this.started = defer(); this.awsUrl = awsUrl(this.con); - this.awsHost = uri(this.awsUrl).host; + + this.awsHost = uri(this.awsUrl).hostname; + /* + * ShreeDee : for compatibility with S3 clones, that are hosted on a non std port. Add the port number + */ + const port = uri(this.awsUrl).port; + + if (!!port && 80 != port && 443 != port) { + this.awsHost += (':' + port ); + } + var r = extend({}, request); if (fileUpload.contentType) {