[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    XMLHttpRequest and http status code 100
From:       Richard =?utf-8?q?L=C3=A4rk=C3=A4ng?= <nouseforaname () home ! se>
Date:       2007-06-14 9:17:11
Message-ID: 200706141117.11415.nouseforaname () home ! se
[Download RAW message or body]

Hi!

When trying to use the site www.vasttrafik.se, and spoofing as either MSIE or 
Firefox I get the error:
"Sys.WebForms.PageRequestManagerServerErrorException: An unknown error 
occurred while processing the request on the server. The status code returned 
from the server was: 100"
when clicking on for example one of the links below "Trafikförändringar".

The problem seems to be that the status for an XMLHttpRequest is 100, when it 
is expected to be 200. I don't know that much about http, but if I understand 
things correctly, the response with status code 100 should just be ignored 
and the next one should be used instead.

So the attached patch does that, and makes the site mentioned above work for 
me again. Does the patch look OK?

/Richard Lärkäng

["xmlhttprequest.patch" (text/x-diff)]

Index: ecma/xmlhttprequest.cpp
===================================================================
--- ecma/xmlhttprequest.cpp	(revision 675286)
+++ ecma/xmlhttprequest.cpp	(arbetskopia)
@@ -548,6 +548,15 @@ static Value httpStatus(const QString& r
 
   int endOfLine = response.find("\n");
   QString firstLine = (endOfLine == -1) ? response : response.left(endOfLine);
+
+  if (firstLine.find("100 Continue") != -1)
+  {
+    if (endOfLine != -1)
+      return httpStatus(response.mid(endOfLine+1));
+    else
+      return Undefined();
+  }
+
   int codeStart = firstLine.find(" ");
   int codeEnd = firstLine.find(" ", codeStart + 1);
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic