From c319c69b1228f5eee2f9d71a71ad021f3d8ba82b Mon Sep 17 00:00:00 2001 From: Patrick Scott Date: Mon, 20 Jul 2009 15:38:17 -0400 Subject: [PATCH] Allow 205 and 305 to have content. 205 is interpreted by Safari to be like 200 and show the given content. Change canHaveResponseBody to allow 205 to have a body. 305 is a very rare server response indicating to the client to use the given Location header as a proxy and reissue the original request. Curl doesn't do anything with this header and neither does internal networking code. For now, we will just allow the response body to propagate to webcore. --- core/java/android/net/http/Request.java | 3 +-- core/java/android/webkit/LoadListener.java | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/java/android/net/http/Request.java b/core/java/android/net/http/Request.java index e160ab686d06b..1b6568e7f1180 100644 --- a/core/java/android/net/http/Request.java +++ b/core/java/android/net/http/Request.java @@ -417,8 +417,7 @@ class Request { } return status >= HttpStatus.SC_OK && status != HttpStatus.SC_NO_CONTENT - && status != HttpStatus.SC_NOT_MODIFIED - && status != HttpStatus.SC_RESET_CONTENT; + && status != HttpStatus.SC_NOT_MODIFIED; } /** diff --git a/core/java/android/webkit/LoadListener.java b/core/java/android/webkit/LoadListener.java index c0b6dab54c29f..4fe4036d3b87c 100644 --- a/core/java/android/webkit/LoadListener.java +++ b/core/java/android/webkit/LoadListener.java @@ -1370,7 +1370,8 @@ class LoadListener extends Handler implements EventHandler { */ private boolean ignoreCallbacks() { return (mCancelled || mAuthHeader != null || - (mStatusCode > 300 && mStatusCode < 400)); + // Allow 305 (Use Proxy) to call through. + (mStatusCode > 300 && mStatusCode < 400 && mStatusCode != 305)); } /**