Skip to content

Commit

Permalink
Fix StringContent test
Browse files Browse the repository at this point in the history
  • Loading branch information
nozzlegear committed Jan 29, 2024
1 parent 817fd26 commit 95a48df
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,16 @@ public async Task CloneAsync_ShouldCloneJsonContent_AndPreserveHeaders()
public async Task CloneAsync_ShouldCloneStringContent_AndPreserveHeaders()
{
// Setup
var stringContent = new StringContent("some-string-content", System.Text.Encoding.UTF8, MediaTypeHeaderValue.Parse("fake/string"))
var stringContent = new StringContent("some-string-content")
{
Headers = { {"some-key-1", "some-value-1"} }
Headers =
{
{"some-key-1", "some-value-1"}
}
};
// The StringContent class has weird class-specific logic around the Content-Type header that set it explicitly
stringContent.Headers.Remove("Content-Type");
stringContent.Headers.Add("Content-Type", "fake/string");
var cloneableRequest = new CloneableRequestMessage(Host, Method, stringContent);
cloneableRequest.Headers.Add("some-key-2", "some-value-2");

Expand Down

0 comments on commit 95a48df

Please sign in to comment.