From: Divye K. <div...@gm...> - 2008-08-10 11:41:50
|
Hi Dean, Response inline. On Sat, Aug 9, 2008 at 7:14 PM, Dean Michael Berris <mik...@gm...>wrote: > Hi Guys, > > I've just checked in revision 48 which fixes the Python CGI script > that returns incomplete headers. I had to make it print the http > status line (which I'm not sure is required) and add the correct line > endings to the printed header: instead of just '\n', I made it print > "\r\n\r\n" in the end to signify that it was the last header responded > to. > I tested the python server using LiveHTTPHeaders addon to Firefox. The current output from the script (after your commit) is: (for http://localhost:8000/cgi-bin/requestinfo.py?q=1111) Content-type: text/plain; charset=us-ascii Query string: q=1111 GET parameters: q - ['1111'] ; POST parameters: Clearly, the Content-type header is being shifted to the body. Please verify this if you can. I have changed the print statement to use sys.stdout.write to write unformatted strings, the print statement interprets the \n on windows to be \r\n - thus causing this issue. Hopefully it should be fixed. What was causing the CGI Test to fail initially? Was it the missing HTTP header? > Divye, please make sure that this is the correct way to do CGI scripts > in Python -- I really have no idea how to do that, and I only hacked > the script to make it not fail in just the CGI case. I haven't tried > this in Windows yet, but I'm thinking it should be do-able. > Hopefully this should be fixed. > > Another thing: maybe we should put the startup/shutdown of the server > in a global fixture in the test suite for localhost_test? Has anybody > done this with Boost.Test before? That way when we start the server, > we should be able to stop it as well at the end of the whole test. > That's a good idea. I just learnt about them. I'll try my hand at it. Divye -- An idealist is one who, on noticing that a rose smells better than a cabbage, concludes that it will also make better soup. H. L. Mencken (1880 - 1956) My official web site: http://people.iitr.ernet.in/shp/061305/ Webmaster: http://www.drkapoorsclinic.com Blog: http://divyekapoor.blogspot.com |