Skip to content

Commit e989a63

Browse files
committed
convert response headers after setting content
Otherwise, we end up overwriting `response.Content.Headers`. Signed-off-by: Joel Dice <[email protected]>
1 parent ddbd68a commit e989a63

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/libraries/System.Net.Http/src/System/Net/Http/WasiHttpHandler/WasiHttpHandler.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,14 @@ public async Task<HttpResponseMessage> SendRequestAsync(HttpRequestMessage reque
5757
cancellationToken.ThrowIfCancellationRequested();
5858

5959
var response = new HttpResponseMessage((HttpStatusCode)incomingResponse.Status());
60-
WasiHttpInterop.ConvertResponseHeaders(incomingResponse, response);
61-
6260

6361
// request body could be still streaming after response headers are received and started streaming response
6462
// we will leave scope of this method
6563
// we need to pass the ownership of the request and this wrapper to the response (via response content stream)
6664
// unless we know that we are not streaming anymore
6765
incomingStream = new WasiInputStream(this, incomingResponse.Consume());// passing self ownership, passing body ownership
6866
response.Content = new StreamContent(incomingStream); // passing incomingStream ownership to SendAsync() caller
67+
WasiHttpInterop.ConvertResponseHeaders(incomingResponse, response);
6968

7069
return response;
7170
}

0 commit comments

Comments
 (0)