Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hamza
jio
Commits
299a0345
Commit
299a0345
authored
Apr 27, 2015
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IndexedDB: return expected content type in getAttachment
parent
dafc0c70
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
src/jio.storage/indexeddbstorage.js
src/jio.storage/indexeddbstorage.js
+6
-1
test/jio.storage/indexeddbstorage.tests.js
test/jio.storage/indexeddbstorage.tests.js
+4
-2
No files found.
src/jio.storage/indexeddbstorage.js
View file @
299a0345
...
...
@@ -283,6 +283,7 @@
IndexedDBStorage
.
prototype
.
getAttachment
=
function
(
id
,
name
,
options
)
{
var
transaction
,
type
,
start
,
end
;
if
(
options
===
undefined
)
{
...
...
@@ -303,6 +304,7 @@
start_index
,
end_index
;
type
=
attachment
.
info
.
content_type
;
start
=
options
.
start
||
0
;
end
=
options
.
end
||
total_length
;
if
(
end
>
total_length
)
{
...
...
@@ -340,8 +342,11 @@
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
array_buffer_list
.
push
(
result_list
[
i
].
blob
);
}
if
((
options
.
start
===
undefined
)
&&
(
options
.
end
===
undefined
))
{
return
new
Blob
(
array_buffer_list
,
{
type
:
type
});
}
blob
=
new
Blob
(
array_buffer_list
,
{
type
:
"
application/octet-stream
"
});
return
blob
.
slice
(
start
,
end
);
return
blob
.
slice
(
start
,
end
,
"
application/octet-stream
"
);
});
};
...
...
test/jio.storage/indexeddbstorage.tests.js
View file @
299a0345
...
...
@@ -1112,7 +1112,7 @@
var
context
=
this
,
attachment
=
"
attachment
"
;
stop
();
expect
(
2
);
expect
(
3
);
deleteIndexedDB
(
context
.
jio
)
.
then
(
function
()
{
...
...
@@ -1126,6 +1126,7 @@
})
.
then
(
function
(
result
)
{
ok
(
result
instanceof
Blob
,
"
Data is Blob
"
);
equal
(
result
.
type
,
"
text/plain;charset=utf-8
"
);
return
jIO
.
util
.
readBlobAsText
(
result
);
})
.
then
(
function
(
result
)
{
...
...
@@ -1144,7 +1145,7 @@
var
context
=
this
,
attachment
=
"
attachment
"
;
stop
();
expect
(
2
);
expect
(
3
);
deleteIndexedDB
(
context
.
jio
)
.
then
(
function
()
{
...
...
@@ -1159,6 +1160,7 @@
})
.
then
(
function
(
result
)
{
ok
(
result
instanceof
Blob
,
"
Data is Blob
"
);
equal
(
result
.
type
,
"
application/octet-stream
"
);
return
jIO
.
util
.
readBlobAsText
(
result
);
})
.
then
(
function
(
result
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment