async-http 0.37.0 → 0.37.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: 26fbaeb1d148dd69a2a092564e4cbee8eda80738a0aa26e510c359634c738a30
4
- data.tar.gz: 8cbfc4b0b94394ff62fdbb67fddf6afbab091a917e4328ddf554871ba0045064
3
+ metadata.gz: 4ec3dbcddab76f2c928387317d213c91f1a7902563cb0393dc257c674b3e8331
4
+ data.tar.gz: 3657bbf504ef8f4f5b1e2f883df414d3c5f4023e9624a56e0167596f29250353
5
5
  SHA512:
6
- metadata.gz: 35064ca4a37d8c02c711855e5bb1fbd8cb915967ed654c1ae73a8f53817f00a9991467627b8e4818ce45583b5961261ff008962bbe4767e514a3c0798fc449b8
7
- data.tar.gz: fa002d0b6433d0da8076a71117850c62913081e9d327023378f150d4c202de73c16a65e761d18ecbb98cf648c91fb1a20ea0e7e52fb3a5b6dd8e514eacd723ed
6
+ metadata.gz: 4a5bb09de3ac1859812ca9ecf9b44e3cdd5e8f4a6a7bf7e3892dda8cdc7b4b71f48dce75d3fd02224b27df3dcbab43fff2a55af9d5e3bd56d7f0c3da2c8528ab
7
+ data.tar.gz: b46858302fb8401e99362b945d0b9d35a36b4918fc2b3e8bc60c4dd4af73471e4535007dfd89d744bd9952c17deb175e1a8b98ef61bc5674785d2c21ab671079
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Async::HTTP
2
2
 
3
- An asynchronous client and server implementation of HTTP/1.0, HTTP/1.1 and HTTP/2.0 including TLS. Support for streaming requests and responses. Built on top of [async] and [async-io]. [falcon] provides a rack-compatible server.
3
+ An asynchronous client and server implementation of HTTP/1.0, HTTP/1.1 and HTTP/2 including TLS. Support for streaming requests and responses. Built on top of [async] and [async-io]. [falcon] provides a rack-compatible server.
4
4
 
5
5
  [![Build Status](https://secure.travis-ci.org/socketry/async-http.svg)](http://travis-ci.org/socketry/async-http)
6
6
  [![Code Climate](https://codeclimate.com/github/socketry/async-http.svg)](https://codeclimate.com/github/socketry/async-http)
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.add_dependency("async", "~> 1.6")
20
20
  spec.add_dependency("async-io", "~> 1.16")
21
21
 
22
- spec.add_dependency("http-protocol", "~> 0.9.0")
22
+ spec.add_dependency("http-protocol", "~> 0.10")
23
23
 
24
24
  # spec.add_dependency("openssl")
25
25
 
@@ -47,9 +47,7 @@ module Async
47
47
 
48
48
  response = super
49
49
 
50
- if !response.body.empty? and content_encoding = response.headers.delete(CONTENT_ENCODING)
51
- body = response.body
52
-
50
+ if body = response.body and !body.empty? and content_encoding = response.headers.delete(CONTENT_ENCODING)
53
51
  # We want to unwrap all encodings
54
52
  content_encoding.reverse_each do |name|
55
53
  if wrapper = @wrappers[name]
@@ -25,15 +25,6 @@ module Async
25
25
  module Body
26
26
  # A generic base class for wrapping body instances. Typically you'd override `#read`.
27
27
  class Readable
28
- # Read all remaining chunks into a buffered body and close the underlying input.
29
- def finish
30
- buffered = Buffered.for(self)
31
-
32
- self.close
33
-
34
- return buffered
35
- end
36
-
37
28
  # The consumer can call stop to signal that the stream output has terminated.
38
29
  def close(error = nil)
39
30
  end
@@ -52,6 +43,15 @@ module Async
52
43
  nil
53
44
  end
54
45
 
46
+ # Read all remaining chunks into a buffered body and close the underlying input.
47
+ def finish
48
+ buffered = Buffered.for(self)
49
+
50
+ self.close
51
+
52
+ return buffered
53
+ end
54
+
55
55
  # Enumerate all chunks until finished, then invoke `#close`.
56
56
  def each
57
57
  return to_enum unless block_given?
@@ -82,6 +82,18 @@ module Async
82
82
  @stream.close
83
83
  end
84
84
 
85
+ def write_empty_body(body)
86
+ super(body)
87
+
88
+ body.close if body
89
+ end
90
+
91
+ def write_body_head(body)
92
+ super(body)
93
+
94
+ body.close if body
95
+ end
96
+
85
97
  def read_chunked_body
86
98
  Body::Chunked.new(self)
87
99
  end
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module HTTP
23
- VERSION = "0.37.0"
23
+ VERSION = "0.37.1"
24
24
  end
25
25
  end
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.37.0
4
+ version: 0.37.1
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-30 00:00:00.000000000 Z
11
+ date: 2018-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.9.0
47
+ version: '0.10'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.9.0
54
+ version: '0.10'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: async-rspec
57
57
  requirement: !ruby/object:Gem::Requirement