httpx 0.6.1 → 0.6.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: 759b02fc81fbf7b664d68e2fdaff9d1d0a6603eaff49f812578b316f649991f8
4
- data.tar.gz: 40b0102c2a7ee89683aecac8a317c37b94012b2147558adf619292d95174dc11
3
+ metadata.gz: 06cc2e51d9b985b5df5b830bcfcdbcde9170253cc90b914dbb54c903106e8627
4
+ data.tar.gz: c1cd4de4e8ef8b1792b4b9e2ef12ff4abda3e101a82add4aeb580953ea641460
5
5
  SHA512:
6
- metadata.gz: 5004da7fd68f89d610ebc29a1d4fd37d7e11b2e415b27035c7a6f1456c09a853ccbdedb60611a466a647da158a10626c124c0b9522e6a4e4bb1d473c36523570
7
- data.tar.gz: b58fa1ae3485e53d5609a2b8a8b582a5ea910254a69d35f72a8c672c33a5ad8e166b3794c295dee67396a8956c7513eb719c8ada28c345f8bc5dff872f359a0d
6
+ metadata.gz: da578cf07f612ab7af2f499aad38aa71e8b8cb447da80f2c0274e75e2364599e1bcccde9cd5ef82ca14078d3a3a7bce9ee533f3ad11f35efba448761b492a496
7
+ data.tar.gz: 1c339abaf5e9f56641546b814c0b073867db4d0aa2c7b44dc5bc7049552b8a8c11dd0743b66f21a8d99bf7bab855b98768c1eb292c3e89400863a9abe1a8f53f
@@ -151,9 +151,9 @@ module HTTPX
151
151
  def array_value(value)
152
152
  case value
153
153
  when Array
154
- value.map { |val| String(val) }
154
+ value.map { |val| String(val).strip }
155
155
  else
156
- [String(value)]
156
+ [String(value).strip]
157
157
  end
158
158
  end
159
159
 
@@ -15,7 +15,7 @@ module HTTPX
15
15
 
16
16
  module InstanceMethods
17
17
  def basic_authentication(user, password)
18
- authentication("Basic #{Base64.strict_encode64("#{URI.escape(user)}:#{URI.escape(password)}")}")
18
+ authentication("Basic #{Base64.strict_encode64("#{user}:#{password}")}")
19
19
  end
20
20
  alias_method :basic_auth, :basic_authentication
21
21
  end
@@ -47,7 +47,7 @@ module HTTPX
47
47
 
48
48
  def initialize(verb, uri, options = {})
49
49
  @verb = verb.to_s.downcase.to_sym
50
- @uri = URI(URI.escape(uri.to_s))
50
+ @uri = URI(uri.to_s)
51
51
  @options = Options.new(options)
52
52
 
53
53
  raise(Error, "unknown method: #{verb}") unless METHODS.include?(@verb)
@@ -60,6 +60,16 @@ module HTTPX
60
60
  @state = :idle
61
61
  end
62
62
 
63
+ if RUBY_VERSION < "2.2"
64
+ # rubocop: disable Lint/UriEscapeUnescape:
65
+ def initialize_with_escape(verb, uri, options = {})
66
+ initialize_without_escape(verb, URI.escape(uri.to_s), options)
67
+ end
68
+ alias_method :initialize_without_escape, :initialize
69
+ alias_method :initialize, :initialize_with_escape
70
+ # rubocop: enable Lint/UriEscapeUnescape:
71
+ end
72
+
63
73
  def merge_headers(h)
64
74
  @headers = @headers.merge(h)
65
75
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTTPX
4
- VERSION = "0.6.1"
4
+ VERSION = "0.6.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.6.1
4
+ version: 0.6.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: 2019-11-22 00:00:00.000000000 Z
11
+ date: 2019-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-2-next