protocol-http 0.30.0 → 0.31.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: 5365fcaf109db92e1db6bc6389e881881f7ec19c4f1bcd747b16d72698e89a7c
4
- data.tar.gz: 11f68df5f5b9370579764e475a0fe1579c3b4d2f06aaed80efb0cb5fa5c6e392
3
+ metadata.gz: 924ae96ed9d907e15583c52df242c08481c7740a677e6c3a594f9d76ce2aad6e
4
+ data.tar.gz: b7f82710d54ba3e2bb2ffb974a2e46d82c734f53d909ea391986bfde260ea16d
5
5
  SHA512:
6
- metadata.gz: 05f867a38d373f1491630bc5a9bf30401b8ac0fa41cec5392787a1fb916d42fa0f14ff8b80078b89246ab5bbdaae40b2dd67b77302571e3cb0803477e48ead4f
7
- data.tar.gz: dbb7ac119a2d46c5150b8a274c89280582d69f64718849a7537d0a4b876f40c0b9a36c47fc3e2d6f27a244e12465d4ba372a3e4c87c7d0e1c738c0757cd672d5
6
+ metadata.gz: 0ea73874b0712492e11a18d8b4d3339cf70604cf60c3b2da62d3cbd437a5af083dacee44dc222be71373abd726051ecf8cd6a063914cb96ad42ef54f35446ed5
7
+ data.tar.gz: 10f2982481609e45edd91c5b9a71bc7cac26957849151455359eb0ba9e55cff79688564f39b4611ea57de622296b1474e8c2d5190c7bbb1a9ea1a559366f6fa0
checksums.yaml.gz.sig CHANGED
Binary file
@@ -57,6 +57,11 @@ module Protocol
57
57
  def call(stream)
58
58
  while chunk = self.read
59
59
  stream.write(chunk)
60
+
61
+ # Flush the stream unless we are immediately expecting more data:
62
+ unless self.ready?
63
+ stream.flush
64
+ end
60
65
  end
61
66
  ensure
62
67
  stream.close
@@ -69,10 +69,10 @@ module Protocol
69
69
  end
70
70
  end
71
71
 
72
- self.each do |name, value|
72
+ self.each do |name, method|
73
73
  define_method(name) do |location, *arguments, **options|
74
74
  self.call(
75
- Request[value, location.to_s, *arguments, **options]
75
+ Request[method, location.to_s, *arguments, **options]
76
76
  )
77
77
  end
78
78
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module HTTP
8
- VERSION = "0.30.0"
8
+ VERSION = "0.31.0"
9
9
  end
10
10
  end
data/readme.md CHANGED
@@ -22,7 +22,11 @@ Please see the [project documentation](https://socketry.github.io/protocol-http/
22
22
 
23
23
  Please see the [project releases](https://socketry.github.io/protocol-http/releases/index) for all releases.
24
24
 
25
- ### Unreleased
25
+ ### v0.31.0
26
+
27
+ - Ensure chunks are flushed if required, when streaming.
28
+
29
+ ### v0.30.0
26
30
 
27
31
  - [`Request[]` and `Response[]` Keyword Arguments](https://socketry.github.io/protocol-http/releases/index#request[]-and-response[]-keyword-arguments)
28
32
  - [Interim Response Handling](https://socketry.github.io/protocol-http/releases/index#interim-response-handling)
data/releases.md CHANGED
@@ -1,12 +1,16 @@
1
1
  # Releases
2
2
 
3
- ## Unreleased
3
+ ## v0.31.0
4
+
5
+ - Ensure chunks are flushed if required, when streaming.
6
+
7
+ ## v0.30.0
4
8
 
5
9
  ### `Request[]` and `Response[]` Keyword Arguments
6
10
 
7
11
  The `Request[]` and `Response[]` methods now support keyword arguments as a convenient way to set various positional arguments.
8
12
 
9
- ```ruby
13
+ ``` ruby
10
14
  # Request keyword arguments:
11
15
  client.get("/", headers: {"accept" => "text/html"}, authority: "example.com")
12
16
 
@@ -21,14 +25,14 @@ The `Request` class now exposes a `#interim_response` attribute which can be use
21
25
 
22
26
  On the client side, you can pass a callback using the `interim_response` keyword argument which will be invoked whenever an interim response is received:
23
27
 
24
- ```ruby
28
+ ``` ruby
25
29
  client = ...
26
30
  response = client.get("/index", interim_response: proc{|status, headers| ...})
27
31
  ```
28
32
 
29
33
  On the server side, you can send an interim response using the `#send_interim_response` method:
30
34
 
31
- ```ruby
35
+ ``` ruby
32
36
  def call(request)
33
37
  if request.headers["expect"] == "100-continue"
34
38
  # Send an interim response:
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.30.0
4
+ version: 0.31.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -47,7 +47,7 @@ cert_chain:
47
47
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
48
48
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
49
49
  -----END CERTIFICATE-----
50
- date: 2024-08-30 00:00:00.000000000 Z
50
+ date: 2024-09-03 00:00:00.000000000 Z
51
51
  dependencies: []
52
52
  description:
53
53
  email:
metadata.gz.sig CHANGED
Binary file