XMLHttpRequest protocol mismatch?

Martin Jordan fanti at spin.de
Thu Nov 25 14:32:37 GMT 2004


hello there,

it seems to me that there is a bug within the XMLHttpRequest-object concerning 
POST-requests.

I tried this:

=============================
<html>
<head>
<script language="javascript">
function foo( )
{
  var req = new XMLHttpRequest( );
  req.open( 'POST', 'http://localhost:2002/huh', false );
  req.send( 'a=helloworld' );
}
</script>
</head>
<body onLoad="foo( )">
</body>
</html>
=============================

and konqueror sends:

=============================
fanti at daniela:~$ netcat -lp 2002
POST /huh HTTP/1.1
Connection: Keep-Alive
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
Pragma: no-cache
Cache-control: no-cache
Accept: text/html, image/jpeg, image/png, text/*, image/*, */*
Accept-Encoding: x-gzip, x-deflate, gzip, deflate
Accept-Charset: iso-8859-15, utf-8;q=0.5, *;q=0.5
Accept-Language: en
Host: localhost:2002

Content-Length: 13

a=helloworld
=============================

the 'Content-Length <n>' should be part of the header and not of the body. 
there is one carriage return/line feed to many.

tested with:

fanti at daniela:~$ konqueror --version
Qt: 3.3.3
KDE: 3.3.1
Konqueror: 3.3.1

regards,
martin

-- 
Martin Jordan - SPiN AG
fanti at spin.de





More information about the kfm-devel mailing list