diff options
author | 2017-10-13 14:31:19 +0200 | |
---|---|---|
committer | 2017-10-13 14:31:19 +0200 | |
commit | f0ab966d7589ccac1aff87432c67bfa96a4aa72b (patch) | |
tree | 6573ebf11e2d2ed4df0d698930b0b9d0c65fad45 /src/api | |
parent | fix S3 secret_access_key (diff) | |
download | ferdium-app-f0ab966d7589ccac1aff87432c67bfa96a4aa72b.tar.gz ferdium-app-f0ab966d7589ccac1aff87432c67bfa96a4aa72b.tar.zst ferdium-app-f0ab966d7589ccac1aff87432c67bfa96a4aa72b.zip |
fix header override in requestsv5.0.0-beta.10
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/server/ServerApi.js | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/api/server/ServerApi.js b/src/api/server/ServerApi.js index b369796e8..86f4c99e7 100644 --- a/src/api/server/ServerApi.js +++ b/src/api/server/ServerApi.js | |||
@@ -512,30 +512,16 @@ export default class ServerApi { | |||
512 | _prepareAuthRequest(options, auth = true) { | 512 | _prepareAuthRequest(options, auth = true) { |
513 | const request = Object.assign(options, { | 513 | const request = Object.assign(options, { |
514 | mode: 'cors', | 514 | mode: 'cors', |
515 | headers: { | 515 | headers: Object.assign({ |
516 | 'Content-Type': 'application/json', | 516 | 'Content-Type': 'application/json', |
517 | 'X-Franz-Source': 'desktop', | 517 | 'X-Franz-Source': 'desktop', |
518 | 'X-Franz-Version': app.getVersion(), | 518 | 'X-Franz-Version': app.getVersion(), |
519 | 'X-Franz-platform': process.platform, | 519 | 'X-Franz-platform': process.platform, |
520 | 'X-Franz-Timezone-Offset': new Date().getTimezoneOffset(), | 520 | 'X-Franz-Timezone-Offset': new Date().getTimezoneOffset(), |
521 | 'X-Franz-System-Locale': app.getLocale(), | 521 | 'X-Franz-System-Locale': app.getLocale(), |
522 | }, | 522 | }, options.headers), |
523 | }); | 523 | }); |
524 | 524 | ||
525 | // const headers = new window.Headers(); | ||
526 | // headers.append('foo', 'bar'); | ||
527 | // console.log(headers, request.headers); | ||
528 | // | ||
529 | // | ||
530 | // // request.headers.map((value, header) => headers.append(header, value)); | ||
531 | // Object.keys(request.headers).map((key) => { | ||
532 | // console.log(key); | ||
533 | // return headers.append(key, request.headers[key]); | ||
534 | // }); | ||
535 | // request.headers = headers; | ||
536 | |||
537 | // console.log(request); | ||
538 | |||
539 | if (auth) { | 525 | if (auth) { |
540 | request.headers.Authorization = `Bearer ${localStorage.getItem('authToken')}`; | 526 | request.headers.Authorization = `Bearer ${localStorage.getItem('authToken')}`; |
541 | } | 527 | } |