Skip to content
This repository was archived by the owner on Sep 9, 2022. It is now read-only.

Commit 87a88f0

Browse files
committed
Released version 1.2.2
1 parent 8b33423 commit 87a88f0

11 files changed

+15
-5
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ var clientCompressionHandler = new ClientCompressionHandler(4096, new GZipCompre
4444
The above code will skip compression for any request/response that is smaller than `4096 bytes` / `4 kB`.
4545

4646
## Version history
47-
#### [1.2.1](https://www.nuget.org/packages/Microsoft.AspNet.WebApi.MessageHandlers.Compression/1.2.1) (current)
47+
#### [1.2.2](https://www.nuget.org/packages/Microsoft.AspNet.WebApi.MessageHandlers.Compression/1.2.2) (current)
48+
* Stop trying to compress requests/responses with no content
49+
50+
#### [1.2.1](https://www.nuget.org/packages/Microsoft.AspNet.WebApi.MessageHandlers.Compression/1.2.1)
4851
* Properly copy HTTP headers from the content that is going to be compressed
4952

5053
#### [1.2.0](https://www.nuget.org/packages/Microsoft.AspNet.WebApi.MessageHandlers.Compression/1.2.0)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

src/Microsoft.AspNet.WebApi.MessageHandlers.Compression/ClientCompressionHandler.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,14 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
100100
try
101101
{
102102
if (response.Content != null)
103+
{
103104
// Buffer content for further processing
104105
await response.Content.LoadIntoBufferAsync();
106+
}
105107
else
108+
{
106109
process = false;
110+
}
107111
}
108112
catch (Exception ex)
109113
{

src/Microsoft.AspNet.WebApi.MessageHandlers.Compression/ServerCompressionHandler.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System;
44
using System.Collections.Generic;
55
using System.Diagnostics;
6-
using System.IO;
76
using System.Linq;
87
using System.Net.Http;
98
using System.Threading;
@@ -102,10 +101,14 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
102101
try
103102
{
104103
if (response.Content != null)
104+
{
105105
// Buffer content for further processing
106106
await response.Content.LoadIntoBufferAsync();
107+
}
107108
else
109+
{
108110
process = false;
111+
}
109112
}
110113
catch (Exception ex)
111114
{

src/NuGetPackage/NuGet.exe

1.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)