response_bank 1.3.4 → 1.3.5

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: 957a84197155753d2caf49d54afce097d7a1a09811c967db2198f92e9767b0ba
4
- data.tar.gz: 81d88f771d974341623fe5ed2cbc612ad4817f3511e28f31c9e753156f32d3a7
3
+ metadata.gz: b24a992a093711fd04ac8768221300e0c238a70b02ea40c49f87a3c05a1b87af
4
+ data.tar.gz: 4665251a057b21f12858b55332f45e8be3587cc9aa787082be32df8082971256
5
5
  SHA512:
6
- metadata.gz: '0188e02f3f014798ad3c88da07268caef4bc3fca5edacec0750ea57a53107c8e43b28343dcb7e75d7cfc7ba970be7dcc3750627bb5fd6b76cf8bad253d08fde6'
7
- data.tar.gz: 5d227ae976f8cac3074ea9e191866b36a5d6ed8b7a85dd7f553988509f957bf3dfc9ac5c620d7f065fe92f395fd66bc0a06642eaf6b81eb4e00487ab109c6586
6
+ metadata.gz: 834669e94059637b751b22783ad10c731b2a327f83bc1448e13d26532506bdb55145b6c12eb29c49fc635cf3cacdc9d6b5cad7c1e62af99000330b5b77e72c5c
7
+ data.tar.gz: c6dccc62b543bef77132a8cfa1de1608c8a32db5abb9c610d71c743e8b94538e079d132f70b90bfb18addf0181f3c1627bd73a45c8e727532a7378cfd7d9399a
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ResponseBank
3
- VERSION = "1.3.4"
3
+ VERSION = "1.3.5"
4
4
  end
data/lib/response_bank.rb CHANGED
@@ -33,7 +33,20 @@ module ResponseBank
33
33
  def compress(content, encoding = "br")
34
34
  case encoding
35
35
  when 'gzip'
36
- Zlib.gzip(content, level: Zlib::BEST_COMPRESSION)
36
+ attempts = 0
37
+
38
+ begin
39
+ Zlib.gzip(content, level: Zlib::BEST_COMPRESSION)
40
+ rescue Zlib::BufError
41
+ # We get sporadic Zlib::BufError, so we retry once (https://github.com/ruby/zlib/issues/49)
42
+ attempts += 1
43
+
44
+ if attempts <= 1
45
+ retry
46
+ else
47
+ raise
48
+ end
49
+ end
37
50
  when 'br'
38
51
  Brotli.deflate(content, mode: :text, quality: 7)
39
52
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: response_bank
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Lütke
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-09-07 00:00:00.000000000 Z
12
+ date: 2024-01-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  requirements: []
149
- rubygems_version: 3.4.19
149
+ rubygems_version: 3.5.4
150
150
  signing_key:
151
151
  specification_version: 4
152
152
  summary: Simple response caching for Ruby applications