File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,16 @@ exports.uploadImage = function (imagePath, callback) {
48
48
const command = new PutObjectCommand ( params )
49
49
50
50
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
52
57
if ( config . s3 . endpoint ) {
53
58
s3Endpoint = config . s3 . endpoint
54
- } else if ( config . s3 . region && config . s3 . region !== 'us-east-1' ) {
55
- s3Endpoint = `s3-${ config . s3 . region } .amazonaws.com`
56
59
}
57
- callback ( null , `https:// ${ s3Endpoint } /${ config . s3bucket } /${ params . Key } ` )
60
+ callback ( null , `${ s3Endpoint } /${ config . s3bucket } /${ params . Key } ` )
58
61
} ) . catch ( err => {
59
62
if ( err ) {
60
63
callback ( new Error ( err ) , null )
You can’t perform that action at this time.
0 commit comments