mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-09 09:27:03 +03:00
Use the new b64EncodeJSONSafe
This commit is contained in:
parent
e6b6531248
commit
76627ae2f6
1 changed files with 3 additions and 17 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
import { isArray, arrayLength, pString, pInt } from 'Common/Utils';
|
import { isArray, arrayLength, pString, pInt, b64EncodeJSONSafe } from 'Common/Utils';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getFolderHash,
|
getFolderHash,
|
||||||
|
|
@ -19,20 +19,6 @@ import { AbstractFetchRemote } from 'Remote/AbstractFetch';
|
||||||
|
|
||||||
import { FolderCollectionModel } from 'Model/FolderCollection';
|
import { FolderCollectionModel } from 'Model/FolderCollection';
|
||||||
|
|
||||||
// unescape(encodeURIComponent()) makes the UTF-16 DOMString to an UTF-8 string
|
|
||||||
const urlSafeJSON = data => btoa(unescape(encodeURIComponent(JSON.stringify(data))))
|
|
||||||
.replace(/\+/g, '-')
|
|
||||||
.replace(/\//g, '_')
|
|
||||||
.replace(/=+$/, '');
|
|
||||||
/* Withous deprecated 'unescape':
|
|
||||||
const urlSafeJSON = data => btoa(encodeURIComponent(JSON.stringify(data)).replace(
|
|
||||||
/%([0-9A-F]{2})/g, (match, p1) => String.fromCharCode('0x' + p1)
|
|
||||||
))
|
|
||||||
.replace(/\+/g, '-')
|
|
||||||
.replace(/\//g, '_')
|
|
||||||
.replace(/=+$/, '');
|
|
||||||
*/
|
|
||||||
|
|
||||||
class RemoteUserFetch extends AbstractFetchRemote {
|
class RemoteUserFetch extends AbstractFetchRemote {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -66,7 +52,7 @@ class RemoteUserFetch extends AbstractFetchRemote {
|
||||||
sGetAdd = 'MessageList/' +
|
sGetAdd = 'MessageList/' +
|
||||||
SUB_QUERY_PREFIX +
|
SUB_QUERY_PREFIX +
|
||||||
'/' +
|
'/' +
|
||||||
urlSafeJSON(params);
|
b64EncodeJSONSafe(params);
|
||||||
params = {};
|
params = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -97,7 +83,7 @@ class RemoteUserFetch extends AbstractFetchRemote {
|
||||||
'Message/' +
|
'Message/' +
|
||||||
SUB_QUERY_PREFIX +
|
SUB_QUERY_PREFIX +
|
||||||
'/' +
|
'/' +
|
||||||
urlSafeJSON([
|
b64EncodeJSONSafe([
|
||||||
sFolderFullName,
|
sFolderFullName,
|
||||||
iUid,
|
iUid,
|
||||||
AppUserStore.threadsAllowed() && SettingsUserStore.useThreads() ? 1 : 0,
|
AppUserStore.threadsAllowed() && SettingsUserStore.useThreads() ? 1 : 0,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue