fix #631: unicode characters in Dropbox files

This commit is contained in:
antelle 2017-05-22 21:50:28 +02:00
parent 245662a941
commit 145aa4bac4
2 changed files with 8 additions and 1 deletions

View File

@ -168,6 +168,10 @@ const StorageDropbox = StorageBase.extend({
return '/' + fileName + '.kdbx';
},
_encodeJsonHttpHeader(json) {
return json.replace(/[\u007f-\uffff]/g, c => '\\u' + ('000' + c.charCodeAt(0).toString(16)).slice(-4));
},
_apiCall: function(args) {
this._oauthAuthorize(err => {
if (err) {
@ -177,7 +181,7 @@ const StorageDropbox = StorageBase.extend({
let headers;
let data = args.data;
if (args.apiArg) {
headers = { 'Dropbox-API-Arg': JSON.stringify(args.apiArg) };
headers = { 'Dropbox-API-Arg': this._encodeJsonHttpHeader(JSON.stringify(args.apiArg)) };
if (args.data) {
headers['Content-Type'] = 'application/octet-stream';
}

View File

@ -1,5 +1,8 @@
Release notes
-------------
##### v1.5.1 (TBD)
`-` fix #631: unicode characters in Dropbox files
##### v1.5.0 (2015-05-20)
`+` plugins
`*` translations are available only as plugins