http_zip 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/lib/http_zip/parser/central_directory.rb +2 -18
- data/lib/http_zip/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef016f3ed8f8c418662aada5f15c3ca27b694ca8a75c0be3a948c08a3d2f2c94
|
4
|
+
data.tar.gz: d213a47bca2ed6763115c3b3b9fd347fef74ab6c29ad66ae04683d78a662646d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 857bd5b367ee45e2399d2ba2e1852f851ca2b22afb33d93d488796d24fed450029d852de1419d8f52fe609fb32a55e6ae03c0cb2fcf038790789cf0961aa5d50
|
7
|
+
data.tar.gz: 6c3d52068d7c4321c0723a2c7e0ed7ea15d6a2c613433d15cc3dacf0d0989ed638b6dc3616d6652d277c07df0f549003536fd901a4e6bcfc7cc62f48a76a294f
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# 2.1.1
|
2
|
+
* Fix issue with detecting EOCD blocks of ZIP files that contain additional data after the EOCD (#2).
|
3
|
+
|
4
|
+
# 2.1.0
|
5
|
+
* Add getters for each entry's compressed and uncompressed size (#1).
|
6
|
+
|
1
7
|
# 2.0.0
|
2
8
|
* Drop dependency on HTTParty
|
3
9
|
* Remove `RangeRequest.server_supports_content_range?` and `RangeRequest.check_server_supports_content_range!`
|
@@ -5,4 +11,4 @@
|
|
5
11
|
* Better separation of server error responses: When the server responds with an error, HttpZip now raises `HttpZip::RequestError`. Only when the response is successful, but not `206 Partial Content`, do we raise `HttpZip::ContentRangeError`.
|
6
12
|
|
7
13
|
# 1.0.0
|
8
|
-
* Initial release
|
14
|
+
* Initial release
|
@@ -66,24 +66,8 @@ module HttpZip
|
|
66
66
|
|
67
67
|
# Scan the downloaded bytes from right to left to find the magic EOCD
|
68
68
|
# block identifier
|
69
|
-
eocd_block_start_index =
|
70
|
-
|
71
|
-
loop do
|
72
|
-
eocd_block_start_index = candidate_eocd_block.rindex(EOCD_BLOCK_IDENTIFIER,
|
73
|
-
search_end_position)
|
74
|
-
|
75
|
-
raise ZipError, "Could not locate valid EOCD block" if eocd_block_start_index.nil?
|
76
|
-
|
77
|
-
# we have a candidate, verify that we found the actual eocd block start by
|
78
|
-
# checking whether its position + length matches the end of the file
|
79
|
-
comment_length = candidate_eocd_block[(eocd_block_start_index + 20)...(eocd_block_start_index + 22)].unpack1("v")
|
80
|
-
if (eocd_block_start_index + 22 + comment_length) == candidate_eocd_block.length
|
81
|
-
# we found it
|
82
|
-
break
|
83
|
-
end
|
84
|
-
|
85
|
-
search_end_position = eocd_block_start_index
|
86
|
-
end
|
69
|
+
eocd_block_start_index = candidate_eocd_block.rindex(EOCD_BLOCK_IDENTIFIER)
|
70
|
+
raise ZipError, "Could not locate valid EOCD block" if eocd_block_start_index.nil?
|
87
71
|
|
88
72
|
eocd_block_start_index
|
89
73
|
end
|
data/lib/http_zip/version.rb
CHANGED