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)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 58170 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

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.