Skip to content
This repository was archived by the owner on Dec 20, 2018. It is now read-only.

React to Content-Md5 fix #229

Merged
merged 1 commit into from
May 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ public async Task FlushBody_CompressesAndFlushes()
var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);

IEnumerable<string> contentMD5 = null;
Assert.False(response.Headers.TryGetValues(HeaderNames.ContentMD5, out contentMD5));
Assert.False(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out contentMD5));
Assert.Single(response.Content.Headers.ContentEncoding, "gzip");

var body = await response.Content.ReadAsStreamAsync();
Expand Down Expand Up @@ -448,7 +448,7 @@ public async Task FlushAsyncBody_CompressesAndFlushes()
var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);

IEnumerable<string> contentMD5 = null;
Assert.False(response.Headers.TryGetValues(HeaderNames.ContentMD5, out contentMD5));
Assert.False(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out contentMD5));
Assert.Single(response.Content.Headers.ContentEncoding, "gzip");

var body = await response.Content.ReadAsStreamAsync();
Expand Down Expand Up @@ -506,7 +506,7 @@ public async Task TrickleWriteAndFlush_FlushesEachWrite()
var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);

IEnumerable<string> contentMD5 = null;
Assert.False(response.Headers.TryGetValues(HeaderNames.ContentMD5, out contentMD5));
Assert.False(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out contentMD5));
Assert.Single(response.Content.Headers.ContentEncoding, "gzip");

var body = await response.Content.ReadAsStreamAsync();
Expand Down Expand Up @@ -564,7 +564,7 @@ public async Task TrickleWriteAndFlushAsync_FlushesEachWrite()
var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);

IEnumerable<string> contentMD5 = null;
Assert.False(response.Headers.TryGetValues(HeaderNames.ContentMD5, out contentMD5));
Assert.False(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out contentMD5));
Assert.Single(response.Content.Headers.ContentEncoding, "gzip");

var body = await response.Content.ReadAsStreamAsync();
Expand Down Expand Up @@ -789,7 +789,7 @@ private void CheckResponseCompressed(HttpResponseMessage response, int expectedB
}
}
Assert.True(containsVaryAcceptEncoding);
Assert.False(response.Headers.TryGetValues(HeaderNames.ContentMD5, out contentMD5));
Assert.False(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out contentMD5));
Assert.Single(response.Content.Headers.ContentEncoding, "gzip");
Assert.Equal(expectedBodyLength, response.Content.Headers.ContentLength);
}
Expand All @@ -813,7 +813,7 @@ private void CheckResponseNotCompressed(HttpResponseMessage response, int expect
{
Assert.False(response.Headers.Contains(HeaderNames.Vary));
}
Assert.NotNull(response.Headers.GetValues(HeaderNames.ContentMD5));
Assert.NotNull(response.Content.Headers.GetValues(HeaderNames.ContentMD5));
Assert.Empty(response.Content.Headers.ContentEncoding);
Assert.Equal(expectedBodyLength, response.Content.Headers.ContentLength);
}
Expand Down