nonnative 3.32.0 → 3.34.0

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: 108231da69ec8bdf5cd71d3b0a2bb1e724c7b7826a3c33b631044873d2de71cb
4
- data.tar.gz: 43b4fb6617eebce09db0b460aa0ad8117290a5a8f952eccbe33f8fbe89ad6766
3
+ metadata.gz: '028726d6f2465ec50e55504560c08adf2a1d4cb1cc487687f4308e03e50ebcaa'
4
+ data.tar.gz: 3309d497da450d41ac5044d446375ed8a937588045dc4a0305240880b59ac03d
5
5
  SHA512:
6
- metadata.gz: 7c9446f51fe18cd021c0baa25d0de2ab3389c01e3d1ec571decc3855c711737012cc5268f42acac6b604f9b9aa7bb957ce5197caf74d8150bf0e395291de78e3
7
- data.tar.gz: 1b4ce6b1bb74f9952f93f66d8064ae90f66108e7fb2038f35e4d52e4dcfe02b40c58469402883c2bd737246d35eb4a44a132b8033a2aa06980e2d7baff580a29
6
+ metadata.gz: 6213f4f042a0dab8767bb29021f80cd4d483b66a805165b746ba28c658532747778c51cf7c6720471d56ab5c2c8412f9694116331171d02b98e722d96eeef815
7
+ data.tar.gz: 1f36fe9bac571d834dfe837fb19173b1d9c062a7389e044df8620a940d38aa3bca40864a7e429dacfb20f15c57a36706d2ed352a1de53f5e86d9b2c8736e1407
@@ -37,7 +37,7 @@ module Nonnative
37
37
  def delay_duration
38
38
  duration = proxy.options[:delay] || 2
39
39
  jitter = proxy.options[:jitter]&.abs
40
- return duration unless jitter
40
+ return [duration, 0].max unless jitter
41
41
 
42
42
  [duration + rand(-jitter..jitter), 0].max
43
43
  end
@@ -74,8 +74,9 @@ module Nonnative
74
74
  # @return [String] upstream URL
75
75
  def build_url(request, settings)
76
76
  uri_class = settings.scheme == 'http' ? URI::HTTP : URI::HTTPS
77
+ query = request.query_string
77
78
 
78
- uri_class.build(host: settings.host, port: settings.port, path: request.path_info, query: request.query_string).to_s
79
+ uri_class.build(host: settings.host, port: settings.port, path: request.path_info, query: query.empty? ? nil : query).to_s
79
80
  end
80
81
 
81
82
  # Executes the upstream request and returns the response.
@@ -4,5 +4,5 @@ module Nonnative
4
4
  # The current gem version.
5
5
  #
6
6
  # @return [String]
7
- VERSION = '3.32.0'
7
+ VERSION = '3.34.0'
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nonnative
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.32.0
4
+ version: 3.34.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Falkowski