Skip to content

Commit

Permalink
Use pre-signed URLs to download file versions
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasHirt committed Jul 20, 2020
1 parent 92700c6 commit fab719d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions apps/files/src/components/FileInfoVersions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
<div v-else>
<span v-translate>No Versions available for this file</span>
</div>
</div></template
>
</div>
</template>
<script>
import Mixins from '../mixins.js'
import { mapGetters } from 'vuex'
Expand Down Expand Up @@ -103,11 +103,9 @@ export default {
const version = this.currentVersionId(file)
const url = this.$client.fileVersions.getFileVersionUrl(this.currentFile.id, version)
const headers = new Headers()
headers.append('Authorization', 'Bearer ' + this.getToken)
headers.append('X-Requested-With', 'XMLHttpRequest')
return this.downloadFileFromUrl(url, headers, file.name)
return this.$client.signUrl(url).then(signedUrl => {
window.location = signedUrl
})
}
}
}
Expand Down

0 comments on commit fab719d

Please sign in to comment.