This repository was archived by the owner on Sep 9, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
src/Microsoft.AspNet.WebApi.MessageHandlers.Compression Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -99,8 +99,11 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
9999
100100 try
101101 {
102- // Buffer content for further processing
103- await response . Content . LoadIntoBufferAsync ( ) ;
102+ if ( response . Content != null )
103+ // Buffer content for further processing
104+ await response . Content . LoadIntoBufferAsync ( ) ;
105+ else
106+ process = false ;
104107 }
105108 catch ( Exception ex )
106109 {
@@ -184,4 +187,4 @@ private async Task DecompressResponse(HttpResponseMessage response)
184187 }
185188 }
186189 }
187- }
190+ }
Original file line number Diff line number Diff line change @@ -101,8 +101,11 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
101101
102102 try
103103 {
104- // Buffer content for further processing
105- await response . Content . LoadIntoBufferAsync ( ) ;
104+ if ( response . Content != null )
105+ // Buffer content for further processing
106+ await response . Content . LoadIntoBufferAsync ( ) ;
107+ else
108+ process = false ;
106109 }
107110 catch ( Exception ex )
108111 {
@@ -184,4 +187,4 @@ private async Task DecompressRequest(HttpRequestMessage request)
184187 }
185188 }
186189 }
187- }
190+ }
You can’t perform that action at this time.
0 commit comments