Skip to content

Commit dfa89e9

Browse files
committed
Updating version to 1.5.7
1 parent c8ff78d commit dfa89e9

File tree

5 files changed

+21
-12
lines changed

5 files changed

+21
-12
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# offline-persistence-toolkit 1.5.6 #
1+
# offline-persistence-toolkit 1.5.7 #
22

33
offline-persistence-toolkit is a client-side JavaScript library that provides caching and offline support at the HTTP request layer. This support is transparent to the user and is done through the Fetch API and an XHR adapter. HTTP requests made while the client device is offline are captured for replay when connection to the server is restored. Additional capabilities include a persistent storage layer, synchronization manager, binary data support and various configuration APIs for customizing the default behavior. This framework can be used in both ServiceWorker and non-ServiceWorker contexts within web and hybrid mobile apps.
44

@@ -58,16 +58,16 @@ If your app uses [RequireJS](http://www.requirejs.org/ "RequireJS"), update the
5858
```javascript
5959
requirejs.config({
6060
paths: {
61-
'persist' : 'js/libs/persist/v1.5.6/min'
61+
'persist' : 'js/libs/persist/v1.5.7/min'
6262

6363
// Other path mappings here
6464
}
6565
```
66-
For Oracle JET apps, also open `appDir/src/js/main-release-paths.json` and add the `'persist' : 'js/libs/persist/v1.5.6/min'` entry to the list of paths.
66+
For Oracle JET apps, also open `appDir/src/js/main-release-paths.json` and add the `'persist' : 'js/libs/persist/v1.5.7/min'` entry to the list of paths.
6767
6868
You can choose the name of the paths prefix. That is, you can use a different value to the ‘persist’ value shown in the examples.
6969
70-
It is recommended to add the version number as a convention in your application build step such as `'persist' : 'js/libs/persist/v1.5.6/min'`.
70+
It is recommended to add the version number as a convention in your application build step such as `'persist' : 'js/libs/persist/v1.5.7/min'`.
7171
7272
Versions of the toolkit are also available on CDN under the latest JET release. e.g.
7373
@@ -91,7 +91,7 @@ And again, if you are using RequireJS, you will need to map paths for these pack
9191
paths: {
9292
'pouchdb': 'js/libs/pouchdb-7.2.2',
9393
'pouchfind': 'js/libs/pouchdb.find',
94-
'persist' : 'js/libs/persist/v1.5.6/min'
94+
'persist' : 'js/libs/persist/v1.5.7/min'
9595

9696
// Other path mappings here
9797
}

USAGE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# offline-persistence-toolkit 1.5.6 #
1+
# offline-persistence-toolkit 1.5.7 #
22

33
# Introduction #
44

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@oracle/offline-persistence-toolkit",
33
"title": "Offline Persistence Toolkit",
4-
"version": "1.5.6",
4+
"version": "1.5.7",
55
"description": "Offline Persistence Toolkit by Oracle Corp.",
66
"author": "oraclejet",
77
"license": "UPL-1.0",

src/persistenceManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ define(['./impl/PersistenceXMLHttpRequest', './impl/PersistenceSyncManager', './
10721072
function _formDataToPromiseArryBuffer(value, key, boundary) {
10731073
return new Promise(function (resolve, reject) {
10741074
var enc = new TextEncoder();
1075-
var endingBuffer = enc.encode('\r\n' +boundary).buffer; //endingBuffer does not change
1075+
var endingBuffer = enc.encode('\r\n' +boundary).buffer; // endingBuffer does not change
10761076
var itemType = value.constructor.name;
10771077
switch (itemType) {
10781078
case "File":

src/persistenceUtils.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,25 @@ define(['./impl/logger'], function (logger) {
9090
}
9191
}
9292

93-
function _isTextPayload(headers) {
93+
function _isTextPayload(headers, isAppJsonText) {
9494

9595
var contentType = headers.get('Content-Type');
9696

9797
// the response is considered text type when contentType value is of
9898
// pattern text/ or application/*json .
99-
if (contentType &&
99+
if (isAppJsonText) {
100+
if (contentType &&
101+
(contentType.match(/.*text\/.*/) ||
102+
contentType.match(/.*application\/.*json.*/))) {
103+
return true;
104+
}
105+
} else {
106+
if (contentType &&
100107
(contentType.match(/.*text\/.*/))) {
101-
return true;
108+
return true;
109+
}
102110
}
111+
103112
return false;
104113
};
105114

@@ -196,7 +205,7 @@ define(['./impl/logger'], function (logger) {
196205
}
197206

198207
if ((source instanceof Request) ||
199-
_isTextPayload(source.headers)) {
208+
_isTextPayload(source.headers, true)) {
200209
return source.text().then(function (text) {
201210
targetObj.body.text = text;
202211
return targetObj;

0 commit comments

Comments
 (0)