Skip to content

Commit

Permalink
fix: handle spaces in bucket prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
qoomon committed Apr 24, 2022
1 parent 931d9bd commit dd902ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- S3 Bucket Explorer Version: 1.9.0 -->
<!-- S3 Bucket Explorer Version: 1.9.1 -->

<!DOCTYPE html>
<html lang="en" style="overflow-y: auto;">
Expand Down Expand Up @@ -402,6 +402,7 @@ <h2 class="subtitle">{{config.subtitle}}</h2>
moment,
validBucketPrefix(prefix) {
if(prefix === '') return true
if(prefix.startsWith(' ') || prefix.endsWith(' ')) return false
if(prefix.includes('//')) return false
if(prefix.startsWith('/') && this.bucketPrefix.includes('/')) return false
return true
Expand Down Expand Up @@ -565,7 +566,7 @@ <h2 class="subtitle">{{config.subtitle}}</h2>
}
},
async mounted() {
window.onpopstate = () => this.pathPrefix = window.location.hash.replace(/^#/, '')
window.onpopstate = () => this.pathPrefix = decodeURIComponent(window.location.hash).replace(/^#/, '')
window.onpopstate()
window.addEventListener('resize', () => {
this.windowWidth = window.innerWidth
Expand Down

0 comments on commit dd902ba

Please sign in to comment.