httpx 0.15.1 → 0.15.2

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: 71d64789176a94e104957666f409c327a17827e4384e1387c14c2471e1b98994
4
- data.tar.gz: 0a516128ac747a041ae8e5d86da78c7687d124f830850484ed372c83d67e4745
3
+ metadata.gz: 63059d2ae3e913d077850d4a95fc5aa4a9f0691aa92834ddf6898d38b8ec0913
4
+ data.tar.gz: a9f689d038c7ee258ce2a2dd68d56fd21104be96b8f12c20a240cd024eea6576
5
5
  SHA512:
6
- metadata.gz: 83f6d5041140e1670e7175db3d9a3269a3766a5b8b29076ba7ee4025ef035411a4458c5df25cce4d70a10fd34fdc1cbda30fa315b3a77c585d58672ec35f737d
7
- data.tar.gz: '05298bf9e3fc41c8fe7315558a6842af2dbe915c8f5cfb119ca019cc8e83dbde93a9d57222bbf0098603b3fde00a5e8f1de05f4d62cf5fe81a6f7213a8c8107d'
6
+ metadata.gz: 940075fbe22ed29a3a0b5a6a85f69ef25bab2dac876eed6779b840b761dd8c7cff09a43f861fd2e39a42b82652d01bcf4aa0384afc1d4d253b9eb82d4f2adb21
7
+ data.tar.gz: 8efa63c8c6c7c5c8869e507e64932167082f27c85d2c3bd026a9bc29d8c052d8e26612e35c06f046b2c9b5c8b6dd102d20a29d7ef67a7babc4c0ad0f990f471b
@@ -0,0 +1,9 @@
1
+ # 0.15.2
2
+
3
+ ## Bugfixes
4
+
5
+ * Fixed cookie management for same-keys: before the fix, cookies with same-key, same-domain and same-path were all being sent in subsequent requests, which violates RFC 6265 - 5.4 . As of now, only the last valid cookie for a given key/domain/path will be kept, evicting the others.
6
+
7
+ ## Chore
8
+
9
+ * debug logs were inserting ASCII code string wrappers, even when no color was set. It nonw only sends the plain string.
@@ -20,7 +20,7 @@ module HTTPX
20
20
  debug_stream = @options.debug
21
21
 
22
22
  message = (+"" << msg.call << "\n")
23
- message = "\e[#{COLORS[color]}m#{message}\e[0m" if debug_stream.respond_to?(:isatty) && debug_stream.isatty
23
+ message = "\e[#{COLORS[color]}m#{message}\e[0m" if color && debug_stream.respond_to?(:isatty) && debug_stream.isatty
24
24
  debug_stream << message
25
25
  end
26
26
 
data/lib/httpx/options.rb CHANGED
@@ -144,7 +144,7 @@ module HTTPX
144
144
  Array(value)
145
145
  OUT
146
146
 
147
- %w[
147
+ %i[
148
148
  params form json body ssl http2_settings
149
149
  request_class response_class headers_class request_body_class response_body_class connection_class
150
150
  io fallback_protocol debug debug_level transport_options resolver_class resolver_options
@@ -171,6 +171,8 @@ module HTTPX
171
171
  end
172
172
 
173
173
  def merge(other)
174
+ raise ArgumentError, "#{other.inspect} is not a valid set of options" unless other.respond_to?(:to_hash)
175
+
174
176
  h2 = other.to_hash
175
177
  return self if h2.empty?
176
178
 
@@ -43,8 +43,7 @@ module HTTPX
43
43
  # Precedence: 1. longer path 2. older creation
44
44
  (@name <=> other.name).nonzero? ||
45
45
  (other.path.length <=> @path.length).nonzero? ||
46
- (@created_at <=> other.created_at).nonzero? ||
47
- @value <=> other.value
46
+ (@created_at <=> other.created_at).nonzero?
48
47
  end
49
48
 
50
49
  class << self
@@ -43,6 +43,10 @@ module HTTPX
43
43
 
44
44
  c.path = path if path && c.path == "/"
45
45
 
46
+ # If the user agent receives a new cookie with the same cookie-name, domain-value, and path-value
47
+ # as a cookie that it has already stored, the existing cookie is evicted and replaced with the new cookie.
48
+ @cookies.delete_if { |ck| ck.name == c.name && ck.domain == c.domain && ck.path == c.path }
49
+
46
50
  @cookies << c
47
51
  end
48
52
 
@@ -95,14 +95,18 @@ class HTTPX::Selector
95
95
  retry
96
96
  end
97
97
 
98
- readers.each do |io|
99
- yield io
98
+ if writers
99
+ readers.each do |io|
100
+ yield io
100
101
 
101
- # so that we don't yield 2 times
102
- writers.delete(io)
103
- end if readers
102
+ # so that we don't yield 2 times
103
+ writers.delete(io)
104
+ end if readers
104
105
 
105
- writers.each(&block) if writers
106
+ writers.each(&block)
107
+ else
108
+ readers.each(&block) if readers
109
+ end
106
110
  end
107
111
 
108
112
  def select_one(interval)
data/lib/httpx/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTTPX
4
- VERSION = "0.15.1"
4
+ VERSION = "0.15.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 0.15.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Cardoso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-24 00:00:00.000000000 Z
11
+ date: 2021-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-2-next
@@ -70,6 +70,7 @@ extra_rdoc_files:
70
70
  - doc/release_notes/0_14_5.md
71
71
  - doc/release_notes/0_15_0.md
72
72
  - doc/release_notes/0_15_1.md
73
+ - doc/release_notes/0_15_2.md
73
74
  - doc/release_notes/0_1_0.md
74
75
  - doc/release_notes/0_2_0.md
75
76
  - doc/release_notes/0_2_1.md
@@ -119,6 +120,7 @@ files:
119
120
  - doc/release_notes/0_14_5.md
120
121
  - doc/release_notes/0_15_0.md
121
122
  - doc/release_notes/0_15_1.md
123
+ - doc/release_notes/0_15_2.md
122
124
  - doc/release_notes/0_1_0.md
123
125
  - doc/release_notes/0_2_0.md
124
126
  - doc/release_notes/0_2_1.md
@@ -292,6 +294,7 @@ metadata:
292
294
  changelog_uri: https://honeyryderchuck.gitlab.io/httpx/#release-notes
293
295
  documentation_uri: https://honeyryderchuck.gitlab.io/httpx/rdoc/
294
296
  source_code_uri: https://gitlab.com/honeyryderchuck/httpx
297
+ homepage_uri: https://honeyryderchuck.gitlab.io/httpx/
295
298
  post_install_message:
296
299
  rdoc_options: []
297
300
  require_paths: