File tree 2 files changed +4
-2
lines changed
client/modules/IDE/actions
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ import {
16
16
import { clearState , saveState } from '../../../persistState' ;
17
17
18
18
const ROOT_URL = getConfig ( 'API_URL' ) ;
19
+ const S3_BUCKET_URL_BASE = getConfig ( 'S3_BUCKET_URL_BASE' ) ;
20
+ const S3_BUCKET = getConfig ( 'S3_BUCKET' ) ;
19
21
20
22
export function setProject ( project ) {
21
23
return {
@@ -287,7 +289,7 @@ export function cloneProject(id) {
287
289
288
290
// duplicate all files hosted on S3
289
291
each ( newFiles , ( file , callback ) => {
290
- if ( file . url && file . url . includes ( 'amazonaws' ) ) {
292
+ if ( file . url && ( file . url . includes ( S3_BUCKET_URL_BASE ) || file . url . includes ( S3_BUCKET ) ) ) {
291
293
const formParams = {
292
294
url : file . url
293
295
} ;
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ function getExtension(filename) {
28
28
export function getObjectKey ( url ) {
29
29
const urlArray = url . split ( '/' ) ;
30
30
let objectKey ;
31
- if ( urlArray . length === 6 ) {
31
+ if ( urlArray . length === 5 ) {
32
32
const key = urlArray . pop ( ) ;
33
33
const userId = urlArray . pop ( ) ;
34
34
objectKey = `${ userId } /${ key } ` ;
You can’t perform that action at this time.
0 commit comments