XHTTP client: Add gRPC header to "stream-up" mode by default (#4042)

""Breaking"": Client uses "stream-up" mode by default when using **TLS H2** or REALITY
This commit is contained in:
RPRX 2024-11-21 05:45:49 +00:00 committed by GitHub
parent 0a252ac15d
commit 817fa72874
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 62 additions and 41 deletions

View file

@ -46,6 +46,9 @@ func (c *DefaultDialerClient) OpenUpload(ctx context.Context, baseURL string) io
reader, writer := io.Pipe()
req, _ := http.NewRequestWithContext(ctx, "POST", baseURL, reader)
req.Header = c.transportConfig.GetRequestHeader()
if !c.transportConfig.NoGRPCHeader {
req.Header.Set("Content-Type", "application/grpc")
}
go c.client.Do(req)
return writer
}