Bug 58170 - HttpStatusCode.MultipleChoices (300) returns InvalidOperationException when using AndroidClientHandler
Summary: HttpStatusCode.MultipleChoices (300) returns InvalidOperationException when u...
Status: CONFIRMED
Alias: None
Product: Android
Classification: Xamarin
Component: General (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2017-07-14 18:28 UTC by Matthew Regul
Modified: 2017-07-14 18:44 UTC (History)
3 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Matthew Regul 2017-07-14 18:28:49 UTC
On Windows and iOS when performing an HTTP Get for an image that results in an HTTP 300 (Multiple Choices) using the native HTTP client handlers you receive an HttpResponse object back with a StatusCode of 300 as expected.  On Android when using AndroidClientHandler to retrieve the same image the code throws a System.InvalidOperationException with a message of "HTTP connection redirected with code MultipleChoices (300) but no Location header found in response occurred".

This may be a result of the following commit: https://github.com/xamarin/xamarin-android/commit/5da5c5e55bda72c8d5cc2100dbafaeb680a6dcbb

Android should behave the same as Windows and iOS.  It should not throw an exception and simply return an HttpResponse with a 300 StatusCode.

Note You need to log in before you can comment on or make changes to this bug.