File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,13 +48,16 @@ exports.uploadImage = function (imagePath, callback) {
4848 const command = new PutObjectCommand ( params )
4949
5050 s3 . send ( command ) . then ( data => {
51- let s3Endpoint = 's3.amazonaws.com'
51+ // default scheme settings to https
52+ let s3Endpoint = 'https://s3.amazonaws.com'
53+ if ( config . s3 . region && config . s3 . region !== 'us-east-1' ) {
54+ s3Endpoint = `s3-${ config . s3 . region } .amazonaws.com`
55+ }
56+ // rewrite endpoint from config
5257 if ( config . s3 . endpoint ) {
5358 s3Endpoint = config . s3 . endpoint
54- } else if ( config . s3 . region && config . s3 . region !== 'us-east-1' ) {
55- s3Endpoint = `s3-${ config . s3 . region } .amazonaws.com`
5659 }
57- callback ( null , `https:// ${ s3Endpoint } /${ config . s3bucket } /${ params . Key } ` )
60+ callback ( null , `${ s3Endpoint } /${ config . s3bucket } /${ params . Key } ` )
5861 } ) . catch ( err => {
5962 if ( err ) {
6063 callback ( new Error ( err ) , null )
You can’t perform that action at this time.
0 commit comments