diff options
author | fengrui <fengrui358@163.com> | 2017-01-13 03:48:19 +0800 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2017-01-12 19:48:19 +0000 |
commit | e7a7a57e4b2f7db71137e702be2663cf4f37d1b4 (patch) | |
tree | 9df55277514d55fc4a8ceb4f539c40d497565359 /Xamarin.Forms.Platform.Android/Forms.cs | |
parent | f81e41b11b4e1398f67f047725c2b3438094d5f8 (diff) | |
download | xamarin-forms-e7a7a57e4b2f7db71137e702be2663cf4f37d1b4.tar.gz xamarin-forms-e7a7a57e4b2f7db71137e702be2663cf4f37d1b4.tar.bz2 xamarin-forms-e7a7a57e4b2f7db71137e702be2663cf4f37d1b4.zip |
fix bug-39359 (#599)
UriImageSource does cache failed HTTP responses
Diffstat (limited to 'Xamarin.Forms.Platform.Android/Forms.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Android/Forms.cs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Android/Forms.cs b/Xamarin.Forms.Platform.Android/Forms.cs index 1ecf76d3..3183c109 100644 --- a/Xamarin.Forms.Platform.Android/Forms.cs +++ b/Xamarin.Forms.Platform.Android/Forms.cs @@ -385,7 +385,14 @@ namespace Xamarin.Forms { using (var client = new HttpClient()) using (HttpResponseMessage response = await client.GetAsync(uri, cancellationToken)) + { + if (!response.IsSuccessStatusCode) + { + Log.Warning("HTTP Request", $"Could not retrieve {uri}, status code {response.StatusCode}"); + return null; + } return await response.Content.ReadAsStreamAsync(); + } } public IIsolatedStorageFile GetUserStoreForApplication() |