Commit Graph

14 Commits

Author SHA1 Message Date
Marten Seemann
f1c7a5df73 http3: migrate the headers tests away from Ginkgo (#5068) 2025-04-22 12:54:31 +02:00
pittgi
3311514d67 http3: reject duplicate pseudo headers (#4993) 2025-03-16 03:52:25 +01:00
Kevin McDonald
b92bf0c80d http3: initialize trailer map with empty trailer entries when parsing the header (#4656)
* feat: pre-populate trailers on response with empty values

* fix: improve comment/func name
2024-09-06 23:59:07 -07:00
Marten Seemann
26a3525337 http3: reject connection-specific header fields, check value of TE (#4655) 2024-09-01 02:20:35 -07:00
Marten Seemann
7c3544ca34 http3: set ContentLength to -1 if no Content-Length header is set (#4645)
This applies to both the http.Response and the http.Request.
2024-08-30 05:28:06 -07:00
Marten Seemann
229937c503 http3: reject the Transfer-Encoding header field (#4646)
The use of Transfer-Encoding is forbidden in HTTP/3, see section 4.1 of
RFC 9114.
2024-08-28 05:31:58 -07:00
Marten Seemann
920bfb46af http3: reject pseudo header fields in trailers (#4639)
* http3: reject pseudo header fields in trailers

As defined in section 4.3 of RFC 9114.

* http3: improve allocs for trailer map

* http3: rename connection.parseTrailer to decodeTrailers
2024-08-23 03:42:18 -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
eb310a6db8 http3: expose an OpenStream method on the RoundTripper (#4409)
The stream exposes two methods required for doing an HTTP request:
SendRequestHeader and ReadResponse. This can be used by applications
that wish to use the stream for non-HTTP content afterwards. This will
lead to a simplification in the API we need to expose for WebTransport,
and will make it easier to send HTTP Datagrams associated with this
stream.
2024-04-09 13:14:14 -07:00
taoso
808f849ca2 http3: only use :protocol pseudo-header for Extended CONNECT (#4261)
* Fix protocol

The default value should be "HTTP/3.0".

* Reject normal request with :protocol header

The :protocol pseudo header is only defined for
Extended Connect requests (RFC 9220).

* save one branch check

* Fix review issue
2024-01-25 19:07:35 -08:00
Marten Seemann
5ae28928db http3: reject unknown pseudo headers (#3973) 2023-07-18 22:42:26 -07:00
Marten Seemann
b6dbfc8c06 http3: reject responses that don't set the :status header (#3975) 2023-07-18 22:26:46 -07:00
Marten Seemann
5d59c3059f http3: deduplicate Content-Length headers (#3972) 2023-07-18 21:52:21 -07:00
Marten Seemann
bb296b8c17 http3: unify handling of request and response headers (#3969) 2023-07-18 21:39:05 -07:00