diff --git a/Dockerfile b/Dockerfile index 1635d3b..d1d9e28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,6 @@ FROM openjdk:8 EXPOSE 8080 WORKDIR /usr/src/app -COPY build/libs/ecs-browser-1.0.0rc2.jar ./ +COPY build/libs/ecs-browser-1.0.0rc3.jar ./ -CMD [ "java", "-jar", "ecs-browser-1.0.0rc2.jar" ] +CMD [ "java", "-jar", "ecs-browser-1.0.0rc3.jar" ] diff --git a/build.gradle b/build.gradle index abf9943..a61ff47 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ description = "ECS browser website" group = 'com.emc.ecs' -version = '1.0.0rc2' +version = '1.0.0rc3' ext.licenseName = '' ext.licenseUrl = '' @@ -30,7 +30,7 @@ defaultTasks 'build' jar { baseName = 'ecs-browser' - version = '1.0.0rc2' + version = '1.0.0rc3' into('META-INF/dependency-license') { from 'build/reports/dependency-license' } diff --git a/src/main/resources/static/javascript/ConfigPage.js b/src/main/resources/static/javascript/ConfigPage.js index acb5448..547226d 100644 --- a/src/main/resources/static/javascript/ConfigPage.js +++ b/src/main/resources/static/javascript/ConfigPage.js @@ -158,7 +158,7 @@ ConfigPage.prototype.showUidPage = function() { var s3 = new EcsS3({endpoint: $endpoint.val(), accessKeyId: $uid.val(),secretAccessKey: $secret.val(), s3ForcePathStyle: true}); s3.getServiceInformation( function( result ) { var messageKey; - if ( result.successful ) { + if ( result && result.successful ) { messageKey = 'uidSuccessPrompt'; } else { messageKey = 'uidFailurePrompt'; diff --git a/src/main/resources/static/javascript/ecs-sdk.js b/src/main/resources/static/javascript/ecs-sdk.js index 340add3..75bacdf 100644 --- a/src/main/resources/static/javascript/ecs-sdk.js +++ b/src/main/resources/static/javascript/ecs-sdk.js @@ -19,19 +19,27 @@ function isNonEmptyString(theString) { return (theString && theString.trim() && (theString != "")); }; +function startsWith( theString, thePrefix ) { + return theString && ( theString.substring(0, thePrefix.length) == thePrefix ); +}; + +function endsWith( theString, theSuffix ) { + return theString && ( theString.substring(theString.length - theSuffix.length) == theSuffix ); +}; + function combineWithDelimiter( part1, part2 ) { var combination; if (!isNonEmptyString(part2)) { combination = part1; } else if (!isNonEmptyString(part1)) { combination = part2; - } else if (part2.startsWith(_s3Delimiter)) { - if (part1.endsWith(_s3Delimiter)) { + } else if ( startsWith( part2, _s3Delimiter ) ) { + if ( endsWith( part1, _s3Delimiter ) ) { combination = part1 + part2.substring(1); } else { combination = part1 + part2; } - } else if (part1.endsWith(_s3Delimiter)) { + } else if ( endsWith( part1, _s3Delimiter ) ) { combination = part1 + part2; } else { combination = part1 + _s3Delimiter + part2; @@ -116,7 +124,7 @@ function makeMetaData( data ) { if ( data && data.headers ) { for ( var key in data.headers ) { if ( data.headers.hasOwnProperty( key ) ) { - if ( !key.toLowerCase().startsWith( _metadataStart ) ) { + if ( !startsWith( key.toLowerCase(), _metadataStart ) ) { metaData[ keyProcessor( key ) ] = data.headers[ key ]; } else { if ( !metaData.Metadata ) {