Author: johnh
Date: Wed Nov 11 21:34:35 2009
New Revision: 835079

URL: http://svn.apache.org/viewvc?rev=835079&view=rev
Log:
Don't treat 3xx as error. Instead, treat as legitimate TEXT response.


Modified:
    incubator/shindig/trunk/features/src/main/javascript/features/core.io/io.js

Modified: 
incubator/shindig/trunk/features/src/main/javascript/features/core.io/io.js
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core.io/io.js?rev=835079&r1=835078&r2=835079&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/core.io/io.js 
(original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/core.io/io.js 
Wed Nov 11 21:34:35 2009
@@ -159,9 +159,16 @@
      oauthErrorText: data.oauthErrorText,
      errors: []
     };
-    if(resp.rc < 200 || resp.rc > 206){
+
+    if (resp.rc < 200 || resp.rc >= 400){
        resp.errors = [resp.rc + " Error"]
     } else if (resp.text) {
+      if (resp.rc >= 300 && resp.rc < 400) {
+        // Redirect pages will usually contain arbitrary
+        // HTML which will fail during parsing, inadvertently
+        // causing a 500 response. Thus we treat as text.
+        params.CONTENT_TYPE = "TEXT";
+      }
       switch (params.CONTENT_TYPE) {
         case "JSON":
         case "FEED":


Reply via email to