Commit Graph

27 Commits

Author SHA1 Message Date
Marten Seemann
5c3af443c1 http3: simplify HTTP datagram handling (#5156) 2025-05-29 06:23:05 +02:00
Marten Seemann
d678f9a86c http3: migrate the response writer tests away from Ginkgo (#5075) 2025-04-23 13:52:22 +08:00
Marten Seemann
ad0ffcbd37 http3: check response writer for http.ResponseController methods (#5071) 2025-04-22 13:37:26 +02:00
Kevin McDonald
09c2ac8aab http3: add HTTP Trailer support for servers (#4630) 2024-09-06 21:51:54 -07:00
Kevin McDonald
17fb3b96ba http3: add client-side HTTP Trailer support (#4581)
* http3: add HTTP Trailer support for clients

This change only adds support to read HTTP trailers sent to clients.

* chore: add protection against some out-of-spec behavior + tests

* chore: re-add test accidentally overwtitten

* chore: empty commit to re-trigger ci

* fix: address some review notes (wip)

* fix: simplify code in stream.Read by using a callback from requestStream.ReadResponse

* restructure where trailers are read and parsed

* WIP simplify trailer parsing design

* chore: refactor to use simpler trailer parsing strategy

* make gofumpt happy

* Update http3/headers.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* remove stray TODO

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2024-08-22 22:25:58 -07:00
Marten Seemann
a3d36f1cbb http3: reject reserved frame types (#4467) 2024-05-04 15:23:40 -07:00
WeidiDeng
93c4785521 http3: sniff Content-Type when flushing the ResponseWriter (#4412)
* try to sniff content-type as long as the data is not written to the client

* only write when body is allowed

* fix tests

* fix tests

* fix header count

* fix lint

* merge from upstream

* merge updates from master

* Update http3/response_writer.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2024-04-27 07:26:21 -07:00
Marten Seemann
2a37c53143 http3: add support for HTTP Datagrams (RFC 9297) (#4452)
* http3: add support for HTTP Datagrams (RFC 9297)

* README: reference HTTP Datagrams (RFC 9297)
2024-04-26 11:21:04 -07:00
Marten Seemann
9bc7bd84cc http3: use a log/slog.Logger for logging (#4449) 2024-04-20 01:59:58 -07:00
Marten Seemann
e48e1d465d http3: simplify response header writing (#4441) 2024-04-17 09:44:36 -07:00
Marten Seemann
90627f6f7c http3: simplify buffering of small responses (#4432) 2024-04-13 16:46:19 -07:00
Marten Seemann
2797f85fc0 switch from unmaintained golang/mock to go.uber.org/mock (#4050) 2023-08-28 02:23:55 -07:00
WeidiDeng
2c0e7e02b0 http3: panic in ResponseWriter.WriteHeader for invalid status codes (#3984)
* response writer: panic for invalid status code

* add tests

* readd imports

* readd imports

* fix imports
2023-07-21 09:50:51 -07:00
WeidiDeng
de8d7a32b8 http3: return http.ErrContentLength when writing too large response (#3953) 2023-07-12 23:20:35 -07:00
WeidiDeng
2c4371b6a9 http3: add Date response header if not set (#3952)
* automatically add date header if not already set

* improve comment for Date header

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2023-07-12 10:30:33 -07:00
Kévin Dunglas
172123c340 http3: add compatibility with net/http.ResponseController (#3790)
* feat: compatibility with "net/http".ResponseController

* better deadline tests

* don't run deadline tests on Go 1.19

* skip deadline tests on Go 1.19
2023-05-01 04:40:33 -07:00
Glonee
a92238b73c http3: sniff HTTP Content Type (#3715)
* add sniff

* add test for sniff

* fix typo in comment

* move bodyAllowedForStatus() to top of the function to aviod calling it twice

* add comments

* format with gofumpt

* fix typo and simplify the code
2023-02-20 17:29:45 -08:00
Avi Rosenberg
7b2c69451e http3: change status codes to const (#3683)
Signed-off-by: Avi Rosenberg <avrumi96@gmail.com>
2023-01-27 14:40:59 -08:00
Marten Seemann
58cedf7a4f rename module, adjust import paths to quic-go/quic-go (#3680) 2023-01-21 19:53:57 -08:00
Marten Seemann
9488539a49 update imports to use qtls and qpack from quic-go GitHub organization (#3676) 2023-01-20 13:42:54 -08:00
Marten Seemann
870fbe7ab0 migrate to Ginkgo v2 2022-10-11 16:38:44 +04:00
Marten Seemann
ff6313fdb3 make the responseWriter hijackable 2022-04-03 14:28:15 +01:00
Marten Seemann
48a2cce9df implement HTTP/3 stream hijacking 2022-04-03 14:28:15 +01:00
Kévin Dunglas
3b916f2e80 allow sending 1xx responses (#3047)
Currently, it's not possible to send informational responses such as 103 Early Hints or 102 Processing.

This patch allows calling WriteHeader() multiple times in order to send informational responses before the final one.
It follows the patch for HTTP/1 (golang/go#42597) and HTTP/2 (golang/net#96).

In conformance with RFC 8297, if the status code is 103 the current content of the header map is also sent. Its content is not removed after the call to WriteHeader() because the headers must also be included in the final response.

The Chrome and Fastly teams are starting a large-scale experiment to measure the real-life impact of the 103 status code.
Using Early Hints is proposed as a (partial) alternative to Server Push, which are going to be removed from Chrome: https://groups.google.com/a/chromium.org/g/blink-dev/c/K3rYLvmQUBY/m/21anpFhxAQAJ

Being able to send this status code from servers implemented using Go would help to see if implementing it in browsers is worth it.
2021-03-05 10:03:31 +08:00
Marten Seemann
35939b25a9 allow access to the underlying quic.Stream from a http.ResponseWriter 2021-01-17 14:35:21 +08:00
Marten Seemann
683230372e use a buffered writer for the http3 response writer 2020-04-02 15:15:29 +07:00
Marten Seemann
4f6d0e651a implement HTTP/3 2019-04-11 09:06:10 +09:00