Skip to content

Commit d5fecf9

Browse files
committed
Add releases.md.
1 parent f3e6a36 commit d5fecf9

File tree

4 files changed

+76
-1
lines changed

4 files changed

+76
-1
lines changed

bake.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# frozen_string_literal: true
2+
3+
# Released under the MIT License.
4+
# Copyright, 2024, by Samuel Williams.
5+
6+
# Update the project documentation with the new version number.
7+
#
8+
# @parameter version [String] The new version number.
9+
def after_gem_release_version_increment(version)
10+
context['releases:update'].call(version)
11+
context['utopia:project:readme:update'].call
12+
end

gems.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
gem "bake-modernize"
2525
gem "bake-gem"
2626

27-
gem "falcon", "~> 0.47"
2827
gem "utopia-project"
28+
gem "bake-releases"
2929
end
3030

3131
group :test do

readme.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ Please see the [project documentation](https://socketry.github.io/async-http/) f
1212

1313
- [Testing](https://socketry.github.io/async-http/guides/testing/index) - This guide explains how to use `Async::HTTP` clients and servers in your tests.
1414

15+
## Releases
16+
17+
Please see the [project releases](https://socketry.github.io/async-http/releases/index) for all releases.
18+
19+
### Unreleased
20+
21+
- [`Async::HTTP::Internet` accepts keyword arguments](https://socketry.github.io/async-http/releases/index#async::http::internet-accepts-keyword-arguments)
22+
23+
### v0.73.0
24+
25+
- [Update support for `interim_response`](https://socketry.github.io/async-http/releases/index#update-support-for-interim_response)
26+
1527
## See Also
1628

1729
- [benchmark-http](https://github.com/socketry/benchmark-http) — A benchmarking tool to report on web server concurrency.

releases.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Releases
2+
3+
## Unreleased
4+
5+
### `Async::HTTP::Internet` accepts keyword arguments
6+
7+
`Async::HTTP::Internet` now accepts keyword arguments for making a request, e.g.
8+
9+
```ruby
10+
internet = Async::HTTP::Internet.instance
11+
12+
# This will let you override the authority (HTTP/1.1 host header, HTTP/2 :authority header):
13+
internet.get("https://proxy.local", authority: "example.com")
14+
15+
# This will let you override the scheme:
16+
internet.get("https://example.com", scheme: "http")
17+
```
18+
19+
## v0.73.0
20+
21+
### Update support for `interim_response`
22+
23+
`Protocol::HTTP::Request` now supports an `interim_response` callback, which will be called with the interim response status and headers. This works on both the client and the server:
24+
25+
```ruby
26+
# Server side:
27+
def call(request)
28+
if request.headers['expect'].include?('100-continue')
29+
request.send_interim_response(100)
30+
end
31+
32+
# ...
33+
end
34+
35+
# Client side:
36+
body = Async::HTTP::Body::Writable.new
37+
38+
interim_repsonse = proc do |status, headers|
39+
if status == 100
40+
# Continue sending the body...
41+
body.write("Hello, world!")
42+
body.close
43+
end
44+
end
45+
46+
Async::HTTP::Internet.instance.post("https://example.com", body, interim_response: interim_response) do |response|
47+
unless response.success?
48+
body.close
49+
end
50+
end
51+
```

0 commit comments

Comments
 (0)