From kfm-devel Thu Jun 14 09:17:11 2007 From: Richard =?utf-8?q?L=C3=A4rk=C3=A4ng?= Date: Thu, 14 Jun 2007 09:17:11 +0000 To: kfm-devel Subject: XMLHttpRequest and http status code 100 Message-Id: <200706141117.11415.nouseforaname () home ! se> X-MARC-Message: https://marc.info/?l=kfm-devel&m=118181270015930 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_XeQcGOECc3lAnqT" --Boundary-00=_XeQcGOECc3lAnqT Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi! When trying to use the site www.vasttrafik.se, and spoofing as either MSIE = or=20 =46irefox I get the error: "Sys.WebForms.PageRequestManagerServerErrorException: An unknown error=20 occurred while processing the request on the server. The status code return= ed=20 from the server was: 100" when clicking on for example one of the links below "Trafikf=C3=B6r=C3=A4nd= ringar". The problem seems to be that the status for an XMLHttpRequest is 100, when = it=20 is expected to be 200. I don't know that much about http, but if I understa= nd=20 things correctly, the response with status code 100 should just be ignored= =20 and the next one should be used instead. So the attached patch does that, and makes the site mentioned above work fo= r=20 me again. Does the patch look OK? /Richard L=C3=A4rk=C3=A4ng --Boundary-00=_XeQcGOECc3lAnqT Content-Type: text/x-diff; charset="utf-8"; name="xmlhttprequest.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xmlhttprequest.patch" 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); --Boundary-00=_XeQcGOECc3lAnqT--