Skip to content

Commit

Permalink
bug fix: If zip item is not compressed, ZipArchiveReader#readAsArrayB…
Browse files Browse the repository at this point in the history
…uffer returns entire buffer.
  • Loading branch information
ukyo committed Mar 24, 2016
1 parent 7fd2c0b commit f848afa
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jsziptools",
"main": "jsziptools.js",
"version": "2.4.2",
"version": "2.4.6",
"homepage": "https://github.com/ukyo/jsziptools",
"authors": [
"ukyo <[email protected]>"
Expand Down
4 changes: 2 additions & 2 deletions jsziptools.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsziptools",
"version": "2.4.5",
"version": "2.4.6",
"description": "It's a utility of zlib, gzip and zip format binary data.",
"main": "jsziptools.js",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion src/ZipArchiveReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ ZipArchiveReader.prototype._getFileInfo = function(filename) {
* @return {Uint8Array} Decompressed bytes.
*/
ZipArchiveReader.prototype._decompress = function(bytes, isCompressed) {
return isCompressed ? algorithms.inflate({buffer: bytes, chunkSize: this.chunkSize}) : bytes;
return isCompressed ? algorithms.inflate({buffer: bytes, chunkSize: this.chunkSize}) : new Uint8Array(bytes);
};

/**
Expand Down

0 comments on commit f848afa

Please sign in to comment.