Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http3: add compatibility with net/http.ResponseController #3790

Merged
merged 4 commits into from
May 1, 2023

Conversation

dunglas
Copy link
Contributor

@dunglas dunglas commented Apr 26, 2023

Go 1.20 added a new "net/http".ResponseController type that allows, among other things, to set per-request timeouts.

This patch adds support for this new type. It is necessary for caddyserver/caddy#5509 and dunglas/mercure#764.

@codecov
Copy link

codecov bot commented Apr 26, 2023

Codecov Report

Merging #3790 (e0f4cc7) into master (4a2a574) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #3790      +/-   ##
==========================================
+ Coverage   84.23%   84.26%   +0.03%     
==========================================
  Files         142      140       -2     
  Lines       14084    14046      -38     
==========================================
- Hits        11863    11835      -28     
+ Misses       1801     1793       -8     
+ Partials      420      418       -2     
Impacted Files Coverage Δ
http3/response_writer.go 85.06% <100.00%> (+0.91%) ⬆️

... and 4 files with indirect coverage changes

@marten-seemann marten-seemann changed the title feat: compatibility with "net/http".ResponseController http3: add compatibility with net/http.ResponseController Apr 27, 2023
@marten-seemann marten-seemann added this to the v0.35 milestone Apr 27, 2023
@marten-seemann marten-seemann self-requested a review April 27, 2023 12:55
Copy link
Member

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a better way to test this? All you're currently testing is that the response writer exposes the deadline functions.

Should we have an integration test in integrationtests/self/http_test.go?

@dunglas
Copy link
Contributor Author

dunglas commented Apr 28, 2023

@marten-seemann better integration tests added (I also tested manually that this patch works well with Mecure and Caddy).

@marten-seemann
Copy link
Member

Thank you @dunglas!

@marten-seemann marten-seemann merged commit 172123c into quic-go:master May 1, 2023
17 checks passed
@dunglas dunglas deleted the feat/ResponseController branch May 2, 2023 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants