This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 52521 - AndroidClientHandler does not support 304 redirect
Summary: AndroidClientHandler does not support 304 redirect
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries (show other bugs)
Version: 7.1 (C9)
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Habersack
URL:
Depends on:
Blocks:
 
Reported: 2017-02-15 11:53 UTC by Tomasz Cielecki
Modified: 2017-03-14 14:13 UTC (History)
3 users (show)

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


Attachments

Description Tomasz Cielecki 2017-02-15 11:53:29 UTC
Say I want to download an e-tagged Blob from Azure Blob storage, usually I would do that by setting a If-None-Match header with the e-tag I currently have (other headers are supported too: https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/Specifying-Conditional-Headers-for-Blob-Service-Operations?redirectedfrom=MSDN).

In case I already have the latest blob version I would get a 304 (Not Modified) status code, otherwise a 200 with the new file etc.

The problem here is that the AndroidClientHandler does not support the 304 Status Code and throws an InvalidOperationException

https://github.com/xamarin/xamarin-android/blob/master/src/Mono.Android/Xamarin.Android.Net/AndroidClientHandler.cs#L453

Would really love to be able to use this handler for Azure Blobs.
Comment 1 Marek Habersack 2017-03-14 13:13:53 UTC
PR opened https://github.com/xamarin/xamarin-android/pull/487
Comment 2 Marek Habersack 2017-03-14 14:10:14 UTC
Fixed in

  xamarin-android/master, commit c68f79ad387d8254ec2f29c4e8eb00ec8ea1eb1e
Comment 3 Marek Habersack 2017-03-14 14:13:41 UTC
Fixed in

   monodroid/master, commit fc64987a5dac4c0bd5e861720c29fba093437f05

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