Created
May 10, 2013 15:35
-
-
Save andreabalducci/5555207 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ResponseContentMd5Handler : DelegatingHandler | |
| { | |
| protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, | |
| System.Threading.CancellationToken cancellationToken) | |
| { | |
| HttpResponseMessage response = await base.SendAsync(request, cancellationToken); | |
| if (response.IsSuccessStatusCode && response.Content != null) | |
| { | |
| response.Content.Headers.ContentMD5 = await MD5Helper.ComputeHash(response.Content); | |
| } | |
| return response; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment