don't send Authorization header to OneDrive

This commit is contained in:
antelle 2018-03-13 19:17:16 +01:00
parent bd5f8afe99
commit 1fefaf91af
2 changed files with 2 additions and 1 deletions

View File

@ -86,7 +86,7 @@ _.extend(StorageBase.prototype, {
return config.error && config.error('timeout', xhr);
});
xhr.open(config.method || 'GET', config.url);
if (this._oauthToken) {
if (this._oauthToken && !config.skipAuth) {
xhr.setRequestHeader('Authorization', 'Bearer ' + this._oauthToken.accessToken);
}
_.forEach(config.headers, (value, key) => {

View File

@ -48,6 +48,7 @@ const StorageOneDrive = StorageBase.extend({
this._xhr({
url: downloadUrl,
responseType: 'arraybuffer',
skipAuth: true,
success: (response, xhr) => {
rev = xhr.getResponseHeader('ETag') || rev;
this.logger.debug('Loaded', path, rev, this.logger.ts(ts));