async-http 0.34.2 → 0.34.3
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 +4 -4
- data/lib/async/http/client.rb +3 -3
- data/lib/async/http/protocol/http2/response.rb +17 -6
- data/lib/async/http/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2286b4231db339b1475ba7c3cc4dadab0238bfefda06e29698b8a137c43969c1
|
4
|
+
data.tar.gz: cc8610973b007b112ef52735aa4b8553f7e4ccdbc44929c2dbecbce8c8beeef1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aaec72d53ef0f56a5220d6e7efbf027264bb926081723231ad6062ce2946099efe01cb80dae1b943faeff4fbbe6293591b97d7d2b27cd9711007037c1825ee7c
|
7
|
+
data.tar.gz: 95b4545de1b8a9e365c62803cbfbf11d712c21eb0b63c9e310c32eb7ace1b9f49dfed6041f4fe5e37efcc33742a70b6ca90ca06333df534588ef0316637a9dbf
|
data/lib/async/http/client.rb
CHANGED
@@ -28,11 +28,11 @@ require_relative 'middleware'
|
|
28
28
|
module Async
|
29
29
|
module HTTP
|
30
30
|
class Client
|
31
|
-
def initialize(endpoint, protocol =
|
31
|
+
def initialize(endpoint, protocol = endpoint.protocol, authority = endpoint.hostname, retries: 3, **options)
|
32
32
|
@endpoint = endpoint
|
33
33
|
|
34
|
-
@protocol = protocol
|
35
|
-
@authority = authority
|
34
|
+
@protocol = protocol
|
35
|
+
@authority = authority
|
36
36
|
|
37
37
|
@retries = retries
|
38
38
|
@pool = connect(**options)
|
@@ -92,12 +92,23 @@ module Async
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def send_request(request)
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
95
|
+
# https://http2.github.io/http2-spec/#rfc.section.8.1.2.3
|
96
|
+
# All HTTP/2 requests MUST include exactly one valid value for the :method, :scheme, and :path pseudo-header fields, unless it is a CONNECT request (Section 8.3). An HTTP request that omits mandatory pseudo-header fields is malformed (Section 8.1.2.6).
|
97
|
+
pseudo_headers = [
|
98
|
+
[SCHEME, HTTPS],
|
99
|
+
[METHOD, request.method],
|
100
|
+
[PATH, request.path],
|
101
|
+
]
|
102
|
+
|
103
|
+
# To ensure that the HTTP/1.1 request line can be reproduced accurately, this pseudo-header field MUST be omitted when translating from an HTTP/1.1 request that has a request target in origin or asterisk form (see [RFC7230], Section 5.3). Clients that generate HTTP/2 requests directly SHOULD use the :authority pseudo-header field instead of the Host header field.
|
104
|
+
if authority = request.authority
|
105
|
+
pseudo_headers << [AUTHORITY, authority]
|
106
|
+
end
|
107
|
+
|
108
|
+
headers = Headers::Merged.new(
|
109
|
+
pseudo_headers,
|
110
|
+
request.headers
|
111
|
+
)
|
101
112
|
|
102
113
|
if request.body.nil?
|
103
114
|
@stream.send_headers(nil, headers, ::HTTP::Protocol::HTTP2::END_STREAM)
|
data/lib/async/http/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.34.
|
4
|
+
version: 0.34.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|