async-http 0.70.0 → 0.71.0

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: f049c61bc6afdaebb893a682209ac35e761efa9a4ef6aea5759e276153a4da80
4
- data.tar.gz: 0334a7f914b12caafa97e7ab00ea3e02845c8451c52c159bbd625ecc9a8f9d51
3
+ metadata.gz: 86bc918af980c024aca7370544452805f98f6b207eb6bc9e86f605ba21a7a612
4
+ data.tar.gz: 595e2f1ce10a7cf2864992380e27398602f7e7ff956f73fd2e733f50bd02ca31
5
5
  SHA512:
6
- metadata.gz: 93188a2d18c3991ac8e1b7306dc26ea552b7094b1683c3c6434ee2b76951c4fa725a280438026cd410ccd1229efd36bbf337173241688e61552a8c9c23f5d07c
7
- data.tar.gz: e0cc2b44db653d9770facff7958a512bb56da5483b07348bc12af17b76fec7cfc22e95a2d3d5fdcb608edac47591304c04e6ab558e5ae07fff816d125d3e0379
6
+ metadata.gz: 0fa98ca844d1f7b956128b17b4587756df1b8d164effb82b6704fbc61f50106095429fd7cb6596f6658ebe050c605b819fcbf3121ebc9939f739c1435f6eaac1
7
+ data.tar.gz: 9489e703af232522f9db1f8d931a2a31c810538b5592cdd0868af102ee3585161a7f912a14b62dcfccd412d1cd06e26e03472bd033c5f4183f4974b3e8d7f6d4
checksums.yaml.gz.sig CHANGED
Binary file
@@ -62,7 +62,7 @@ module Async
62
62
  # @option hostname [String] the hostname to connect to (or bind to), overrides the URL hostname (used for SNI).
63
63
  # @option port [Integer] the port to bind to, overrides the URL port.
64
64
  # @option ssl_context [OpenSSL::SSL::SSLContext] the context to use for TLS.
65
- # @option alpn_protocols [Array<String>] the alpn protocols to negotiate.
65
+ # @option alpn_protocols [Array(String)] the alpn protocols to negotiate.
66
66
  def initialize(url, endpoint = nil, **options)
67
67
  super(**options)
68
68
 
@@ -1,8 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2018-2023, by Samuel Williams.
5
- # Copyright, 2019-2020, by Brian Morearty.
4
+ # Copyright, 2024, by Samuel Williams.
6
5
 
7
6
  require_relative '../reference'
8
7
 
@@ -141,4 +140,4 @@ module Async
141
140
  end
142
141
  end
143
142
  end
144
- end
143
+ end
@@ -7,6 +7,7 @@
7
7
  # Copyright, 2024, by Anton Zhuravsky.
8
8
 
9
9
  require_relative 'connection'
10
+ require 'console/event/failure'
10
11
 
11
12
  module Async
12
13
  module HTTP
@@ -17,8 +18,9 @@ module Async
17
18
  @persistent = false
18
19
  write_response(@version, status, {})
19
20
  write_body(@version, nil)
20
- rescue Errno::ECONNRESET, Errno::EPIPE
21
- # Nothing we can do...
21
+ rescue => error
22
+ # At this point, there is very little we can do to recover:
23
+ Console::Event::Failure.for(error).emit(self, "Failed to write failure response.", severity: :debug)
22
24
  end
23
25
 
24
26
  def next_request
@@ -33,13 +35,9 @@ module Async
33
35
  end
34
36
 
35
37
  return request
36
- rescue Async::TimeoutError
37
- # For an interesting discussion about this behaviour, see https://trac.nginx.org/nginx/ticket/1005
38
- # If you enable this, you will see some spec failures...
39
- # fail_request(408)
40
- raise
41
- rescue
38
+ rescue ::Protocol::HTTP1::BadRequest
42
39
  fail_request(400)
40
+ # Conceivably we could retry here, but we don't really know how bad the error is, so it's better to just fail:
43
41
  raise
44
42
  end
45
43
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2018-2023, by Samuel Williams.
4
+ # Copyright, 2018-2024, by Samuel Williams.
5
5
  # Copyright, 2019-2020, by Brian Morearty.
6
6
 
7
7
  require_relative 'middleware/location_redirector'
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module HTTP
8
- VERSION = "0.70.0"
8
+ VERSION = "0.71.0"
9
9
  end
10
10
  end
data/readme.md CHANGED
@@ -12,6 +12,14 @@ Please see the [project documentation](https://socketry.github.io/async-http/) f
12
12
 
13
13
  - [Testing](https://socketry.github.io/async-http/guides/testing/index) - This guide explains how to use `Async::HTTP` clients and servers in your tests.
14
14
 
15
+ ## See Also
16
+
17
+ - [benchmark-http](https://github.com/socketry/benchmark-http) — A benchmarking tool to report on web server concurrency.
18
+ - [falcon](https://github.com/socketry/falcon) — A rack compatible server built on top of `async-http`.
19
+ - [async-websocket](https://github.com/socketry/async-websocket) — Asynchronous client and server websockets.
20
+ - [async-rest](https://github.com/socketry/async-rest) — A RESTful resource layer built on top of `async-http`.
21
+ - [async-http-faraday](https://github.com/socketry/async-http-faraday) — A faraday adapter to use `async-http`.
22
+
15
23
  ## Contributing
16
24
 
17
25
  We welcome contributions to this project.
@@ -22,14 +30,6 @@ We welcome contributions to this project.
22
30
  4. Push to the branch (`git push origin my-new-feature`).
23
31
  5. Create new Pull Request.
24
32
 
25
- ## See Also
26
-
27
- - [benchmark-http](https://github.com/socketry/benchmark-http) — A benchmarking tool to report on web server concurrency.
28
- - [falcon](https://github.com/socketry/falcon) — A rack compatible server built on top of `async-http`.
29
- - [async-websocket](https://github.com/socketry/async-websocket) — Asynchronous client and server websockets.
30
- - [async-rest](https://github.com/socketry/async-rest) — A RESTful resource layer built on top of `async-http`.
31
- - [async-http-faraday](https://github.com/socketry/async-http-faraday) — A faraday adapter to use `async-http`.
32
-
33
33
  ### Developer Certificate of Origin
34
34
 
35
35
  In order to protect users of this project, we require all contributors to comply with the [Developer Certificate of Origin](https://developercertificate.org/). This ensures that all contributions are properly licensed and attributed.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.70.0
4
+ version: 0.71.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -58,7 +58,7 @@ cert_chain:
58
58
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
59
59
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
60
60
  -----END CERTIFICATE-----
61
- date: 2024-08-14 00:00:00.000000000 Z
61
+ date: 2024-08-26 00:00:00.000000000 Z
62
62
  dependencies:
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: async
@@ -136,14 +136,14 @@ dependencies:
136
136
  requirements:
137
137
  - - "~>"
138
138
  - !ruby/object:Gem::Version
139
- version: '0.19'
139
+ version: '0.20'
140
140
  type: :runtime
141
141
  prerelease: false
142
142
  version_requirements: !ruby/object:Gem::Requirement
143
143
  requirements:
144
144
  - - "~>"
145
145
  - !ruby/object:Gem::Version
146
- version: '0.19'
146
+ version: '0.20'
147
147
  - !ruby/object:Gem::Dependency
148
148
  name: protocol-http2
149
149
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file