summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android/Forms.cs
diff options
context:
space:
mode:
authorfengrui <fengrui358@163.com>2017-01-12 19:48:19 (GMT)
committerRui Marinho <me@ruimarinho.net>2017-01-12 19:48:19 (GMT)
commite7a7a57e4b2f7db71137e702be2663cf4f37d1b4 (patch)
tree9df55277514d55fc4a8ceb4f539c40d497565359 /Xamarin.Forms.Platform.Android/Forms.cs
parentf81e41b11b4e1398f67f047725c2b3438094d5f8 (diff)
downloadxamarin-forms-e7a7a57e4b2f7db71137e702be2663cf4f37d1b4.zip
xamarin-forms-e7a7a57e4b2f7db71137e702be2663cf4f37d1b4.tar.gz
xamarin-forms-e7a7a57e4b2f7db71137e702be2663cf4f37d1b4.tar.bz2
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.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Android/Forms.cs b/Xamarin.Forms.Platform.Android/Forms.cs
index 1ecf76d..3183c10 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()