From a80625b7b91d7b6d220fb997d37d7750540d50e5 Mon Sep 17 00:00:00 2001
From: Tristan Cavelier <tristan.cavelier@tiolive.com>
Date: Wed, 30 Oct 2013 12:00:31 +0100
Subject: [PATCH] localstorage.js digest added to getAttachment

---
 src/jio.storage/localstorage.js        | 1 +
 test/jio.storage/localstorage.tests.js | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/jio.storage/localstorage.js b/src/jio.storage/localstorage.js
index 09cf13a..9d1f8ed 100644
--- a/src/jio.storage/localstorage.js
+++ b/src/jio.storage/localstorage.js
@@ -311,6 +311,7 @@
         this._localpath + "/" + param._id +
           "/" + param._attachment
       ) || "",
+      "digest": doc._attachments[param._attachment].digest,
       "content_type": doc._attachments[param._attachment].content_type || ""
     });
   };
diff --git a/test/jio.storage/localstorage.tests.js b/test/jio.storage/localstorage.tests.js
index 69c710e..8adf2c5 100644
--- a/test/jio.storage/localstorage.tests.js
+++ b/test/jio.storage/localstorage.tests.js
@@ -388,6 +388,8 @@
         deepEqual(answers[1], {
           "attachment": "putattmt2",
           "id": "putattmt1",
+          "digest": "sha256-e3b0c44298fc1c149afbf4c8996fb9242" +
+            "7ae41e4649b934ca495991b7852b855",
           "method": "getAttachment",
           "result": "success",
           "status": 200,
-- 
2.30.9