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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19b6d04b94e6807748d28eaa6efd8fea800ffa3954483f6054d9a72ffc33c5d6
4
- data.tar.gz: 43616195f5b74a786b384757a5cad9ee0928dc7b9b13ec7f43294abe036a1f33
3
+ metadata.gz: ef016f3ed8f8c418662aada5f15c3ca27b694ca8a75c0be3a948c08a3d2f2c94
4
+ data.tar.gz: d213a47bca2ed6763115c3b3b9fd347fef74ab6c29ad66ae04683d78a662646d
5
5
  SHA512:
6
- metadata.gz: 6b4f9b7fccbefa2a04bb61a7127ac70fad27129f58b0bbe0a7081e4e175359272de6f4db2ec98fc73887adfe34b339823b13606a3f9dc9afe9df7cba932fe4d4
7
- data.tar.gz: f280e3fcb4fef1c70a83e80ed09916eea48a6918a3055b41b099b88365dcd2a569e516a1cb86b9b56a9e35ee414b02aece303796f3c4da47e3eef476a03673d0
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 = nil
70
- search_end_position = candidate_eocd_block.length
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HttpZip
4
- VERSION = "2.1.0"
4
+ VERSION = "2.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_zip
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marvin Killing