File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
client/modules/IDE/actions Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ import {
1616import { clearState , saveState } from '../../../persistState' ;
1717
1818const ROOT_URL = getConfig ( 'API_URL' ) ;
19+ const S3_BUCKET_URL_BASE = getConfig ( 'S3_BUCKET_URL_BASE' ) ;
20+ const S3_BUCKET = getConfig ( 'S3_BUCKET' ) ;
1921
2022export function setProject ( project ) {
2123 return {
@@ -287,7 +289,7 @@ export function cloneProject(id) {
287289
288290 // duplicate all files hosted on S3
289291 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 ) ) ) {
291293 const formParams = {
292294 url : file . url
293295 } ;
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ function getExtension(filename) {
2828export function getObjectKey ( url ) {
2929 const urlArray = url . split ( '/' ) ;
3030 let objectKey ;
31- if ( urlArray . length === 6 ) {
31+ if ( urlArray . length === 5 ) {
3232 const key = urlArray . pop ( ) ;
3333 const userId = urlArray . pop ( ) ;
3434 objectKey = `${ userId } /${ key } ` ;
You can’t perform that action at this time.
0 commit comments