httpx 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd416a44c18c7d00a8257aa0bdb1532c670ef1b9a6b467d21600014544c03df6
4
- data.tar.gz: 3b7dce3446530daa9acb1b66b2844ffc88fe50a95e225750d1d83ec052dd4a4b
3
+ metadata.gz: 4c5b48a5d65398810ef73e2361ca65c113091b91f1dcb88cf7602da6c680e1b1
4
+ data.tar.gz: 9995ed5b22888e9e0a737be6c197d1d30f5b21d06a7b304242cd3c86efe2f386
5
5
  SHA512:
6
- metadata.gz: 46995eff536a340ec6d70743b650dd7dcb41fcd146308a3ff863980c1b74e8454fa45838b39a94c14a83ca6c6c6d9d8715c51a7bab4a4a969cae0cbf6154d3e8
7
- data.tar.gz: 4199024dbaf25064ddb778cabcb8cbd33508ba1715742b774626deda7007ae627aca6523da4c8bbd410b67e7a431754d67f6deb50820953a4420128866319c31
6
+ metadata.gz: bd3877426964516076b6516237169d06435ff9e39dc44ba977e993de3dfbdcbf90b5a7e486e5f76827f89032d0c9ac5e1d2bac144d025fbe888ff3e07384243d
7
+ data.tar.gz: 91fcd80f50d0ea4ca564291f4568e78a991b36e52eeb10033dd4e054ff27e7895961b2b69d6d1058eae1be646ee037707e8e9e056994305920cab5a6f3ed61a3
data/README.md CHANGED
@@ -102,6 +102,8 @@ The test suite runs against [httpbin proxied over nghttp2](https://nghttp2.org/h
102
102
 
103
103
  All Rubies greater or equal to 2.1, and always latest JRuby.
104
104
 
105
+ **Note**: This gem is tested against all latest patch versions, i.e. if you're using 2.2.0 and you experience some issue, please test it against 2.2.10 (latest patch version of 2.2) before creating an issue.
106
+
105
107
  ## Resources
106
108
  | | |
107
109
  | ------------- | --------------------------------------------------- |
@@ -112,12 +114,18 @@ All Rubies greater or equal to 2.1, and always latest JRuby.
112
114
 
113
115
  ## Caveats
114
116
 
117
+ ### ALPN support
118
+
115
119
  `HTTPS` TLS backend is ruby's own `openssl` gem.
116
120
 
117
121
  If your requirement is to run requests over HTTP/2 and TLS, make sure you run a version of the gem which compiles OpenSSL 1.0.2 (Ruby 2.3 and higher are guaranteed to).
118
122
 
119
123
  JRuby's `openssl` is based on Bouncy Castle, which is massively outdated and still doesn't implement ALPN. So HTTP/2 over TLS/ALPN negotiation is off until JRuby figures this out.
120
124
 
125
+ ### Known bugs
126
+
127
+ Doesn't work with ruby 2.4.0 for Windows (see [#36](https://gitlab.com/honeyryderchuck/httpx/issues/36)).
128
+
121
129
  ## Contributing
122
130
 
123
131
  * Discuss your contribution in an issue
@@ -13,7 +13,7 @@ module HTTPX
13
13
  end
14
14
 
15
15
  def timeout(**args)
16
- branch(timeout: args)
16
+ branch(default_options.with_timeout(args))
17
17
  end
18
18
 
19
19
  def headers(headers)
@@ -47,7 +47,7 @@ module HTTPX
47
47
  when "http" then "tcp"
48
48
  when "https" then "ssl"
49
49
  else
50
- raise Error, "#{uri}: #{uri.scheme}: unrecognized channel"
50
+ raise Error, "#{uri}: #{uri.scheme}: unsupported URI scheme"
51
51
  end
52
52
  end
53
53
  new(type, uri, options)
@@ -84,8 +84,8 @@ module HTTPX
84
84
  when 2, 3
85
85
  verb, uris = args
86
86
  if uris.respond_to?(:each)
87
- uris.map do |uri|
88
- __build_req(verb, uri, options)
87
+ uris.map do |uri, **opts|
88
+ __build_req(verb, uri, options.merge(opts))
89
89
  end
90
90
  else
91
91
  [__build_req(verb, uris, options)]
@@ -10,7 +10,7 @@ module HTTPX
10
10
 
11
11
  module InstanceMethods
12
12
  def basic_authentication(user, password)
13
- authentication("Basic #{Base64.strict_encode64("#{user}:#{password}")}")
13
+ authentication("Basic #{Base64.strict_encode64("#{URI.escape(user)}:#{URI.escape(password)}")}")
14
14
  end
15
15
  alias_method :basic_auth, :basic_authentication
16
16
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTTPX
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
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.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Cardoso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-20 00:00:00.000000000 Z
11
+ date: 2018-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-2