Commit 3d97883d authored by Alain Takoudjou's avatar Alain Takoudjou

replicated opml now check signature and use new parser storage

parent 134f4eda
...@@ -182,11 +182,7 @@ module.exports = function (grunt) { ...@@ -182,11 +182,7 @@ module.exports = function (grunt) {
'src/jio.storage/localstorage.js', 'src/jio.storage/localstorage.js',
'src/jio.storage/indexeddbstorage.js', 'src/jio.storage/indexeddbstorage.js',
'src/jio.storage/cryptstorage.js', 'src/jio.storage/cryptstorage.js',
'src/jio.storage/websqlstorage.js', 'src/jio.storage/websqlstorage.js'
'src/jio.storage/rssfeedstorage.js',
'src/jio.storage/opmlstorage.js',
'src/jio.storage/replicatedopmltreestorage.js',
'src/jio.storage/webhttpstorage.js'
], ],
dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.js' dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.js'
// dest: 'jio.js' // dest: 'jio.js'
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
<script src="../node_modules/rsvp/dist/rsvp-2.0.4.js"></script> <script src="../node_modules/rsvp/dist/rsvp-2.0.4.js"></script>
<script src="../dist/jio-latest.js"></script> <script src="../dist/jio-latest.js"></script>
<script src="../src/jio.storage/replicatedopmltreestorage.js"></script>
<script src="../src/jio.storage/webhttpstorage.js"></script>
<link rel="stylesheet" href="../node_modules/grunt-contrib-qunit/test/libs/qunit.css" type="text/css" media="screen"/> <link rel="stylesheet" href="../node_modules/grunt-contrib-qunit/test/libs/qunit.css" type="text/css" media="screen"/>
<script src="../node_modules/grunt-contrib-qunit/test/libs/qunit.js" type="text/javascript"></script> <script src="../node_modules/grunt-contrib-qunit/test/libs/qunit.js" type="text/javascript"></script>
......
This diff is collapsed.
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
throw new jIO.util.jIOError("id " + id + " is forbidden (no begin /)", throw new jIO.util.jIOError("id " + id + " is forbidden (no begin /)",
400); 400);
} }
if (id.lastIndexOf("/") !== (id.length - 1)) { if (id.lastIndexOf("/") === (id.length - 1)) {
throw new jIO.util.jIOError("id " + id + " is forbidden (no end /)", throw new jIO.util.jIOError("id " + id + " is forbidden (no end /)",
400); 400);
} }
...@@ -84,14 +84,19 @@ ...@@ -84,14 +84,19 @@
} }
WEBHTTPStorage.prototype.get = function (id) { WEBHTTPStorage.prototype.get = function (id) {
var context = this, var context = this;
element;
id = restrictDocumentId(id); id = restrictDocumentId(id);
element = getJsonDocument(context, id); return getJsonDocument(context, id)
if (element !== undefined) { .push(function (element) {
return element.doc; return element.doc;
}, function (error) {
if ((error.target !== undefined) &&
(error.target.status === 404)) {
throw new jIO.util.jIOError("Cannot find document", 404);
} }
throw error;
});
}; };
WEBHTTPStorage.prototype.hasCapacity = function (capacity) { WEBHTTPStorage.prototype.hasCapacity = function (capacity) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment