[banshee/gio-hardware] [AsyncWebClient] Handle HTTP error 406 in the redirection workaround
- From: Alex Launi <alexlauni src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee/gio-hardware] [AsyncWebClient] Handle HTTP error 406 in the redirection workaround
- Date: Fri, 13 Aug 2010 15:24:08 +0000 (UTC)
commit 8812ad7ab18a357fc31374c247d92936b1697376
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date: Sat Aug 7 17:57:27 2010 +0200
[AsyncWebClient] Handle HTTP error 406 in the redirection workaround
The workaround in place to handle the fact that HttpWebRequest
auto-redirects don't work with some servers only handled the BadRequest
status code. Some servers return 406 NotAcceptable in that case. This
fixes the subscription to all podcasts from podbean.com (bgo#600340).
src/Libraries/Migo/Migo.Net/AsyncWebClient.cs | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/Libraries/Migo/Migo.Net/AsyncWebClient.cs b/src/Libraries/Migo/Migo.Net/AsyncWebClient.cs
index 29f4b61..d41e3ee 100644
--- a/src/Libraries/Migo/Migo.Net/AsyncWebClient.cs
+++ b/src/Libraries/Migo/Migo.Net/AsyncWebClient.cs
@@ -560,7 +560,10 @@ namespace Migo.Net
err = we;
HttpWebResponse response = we.Response as HttpWebResponse;
- if (response != null && response.StatusCode == HttpStatusCode.BadRequest && response.ResponseUri != request.RequestUri) {
+ if (response != null
+ && (response.StatusCode == HttpStatusCode.BadRequest
+ || response.StatusCode == HttpStatusCode.NotAcceptable)
+ && response.ResponseUri != request.RequestUri) {
Hyena.Log.DebugFormat ("Identified Content-Length: 0 redirection bug for {0}; trying to get {1} directly", request.RequestUri, response.ResponseUri);
redirect_workaround = true;
uri = response.ResponseUri;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]