Skip to content

Commit 9780a38

Browse files
authored
Merge branch 'main' into service-handler-timeout
2 parents cc784c6 + 64e372d commit 9780a38

File tree

13 files changed

+607
-72
lines changed

13 files changed

+607
-72
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
version: 1.24.x
2424
steps:
2525
- name: Checkout Code
26-
uses: actions/checkout@v5
26+
uses: actions/checkout@v6
2727
with:
2828
fetch-depth: 1
2929
- name: Install Go
@@ -51,7 +51,7 @@ jobs:
5151
version: 1.24.x
5252
steps:
5353
- name: Checkout Code
54-
uses: actions/checkout@v5
54+
uses: actions/checkout@v6
5555
with:
5656
fetch-depth: 1
5757
- name: Install Go
@@ -64,7 +64,7 @@ jobs:
6464
runs-on: ubuntu-latest
6565
steps:
6666
- name: Checkout Code
67-
uses: actions/checkout@v5
67+
uses: actions/checkout@v6
6868
with:
6969
fetch-depth: 1
7070
- name: Install Go

.github/workflows/windows.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
version: 1.24.x
2424
steps:
2525
- name: Checkout Code
26-
uses: actions/checkout@v5
26+
uses: actions/checkout@v6
2727
with:
2828
fetch-depth: 1
2929
- name: Install Go

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/.tmp/
22
*.pprof
33
*.svg
4+
.idea
45
cover.out
56
connect.test

client.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ func NewClient[Req, Res any](httpClient HTTPClient, url string, options ...Clien
8282
callInfo, ok := clientCallInfoForContext(ctx)
8383
if ok {
8484
callInfo.method = r.Method
85+
callInfo.responseSource = conn
8586
}
8687
})
8788
// Send always returns an io.EOF unless the error is from the client-side.
@@ -139,12 +140,6 @@ func NewClient[Req, Res any](httpClient HTTPClient, url string, options ...Clien
139140
if !ok {
140141
return nil, errorf(CodeInternal, "unexpected client response type %T", response)
141142
}
142-
if callInfoOk {
143-
// Wrap the response and set it into the context callinfo
144-
callInfo.responseSource = &responseWrapper[Res]{
145-
response: typed,
146-
}
147-
}
148143
return typed, nil
149144
}
150145
return client
@@ -298,8 +293,8 @@ func (c *Client[Req, Res]) newConn(ctx context.Context, streamType StreamType, o
298293
callInfo.spec = conn.Spec()
299294
callInfo.responseSource = conn
300295

301-
// Merge any callInfo request headers first, then do the request.
302-
// so that context headers show first in the list of headers
296+
// Merge any callInfo request headers first, then do the request,
297+
// so that context headers show first in the list of headers.
303298
mergeHeaders(conn.RequestHeader(), callInfo.RequestHeader())
304299
}
305300

0 commit comments

Comments
 (0)