In Quixote 2, server/simple_server.py is very similar to CGIHTTPServer, in that it is a subclass of BaseHTTPServer and serves CGI. It fixes this response problem and provides a more complete CGI CGI environment, so you should check it out. > I know. But I like CGIHTTPServer from standard library of python. This > way you don't need any "real" HTTP Server. > > Looking at the source (1.x) I don't see a way to subclass HTTPResponse > or > HTTPRequest. Because we are python programmers, we have some options besides subclassing. These options feel a little like cheating, since they are not available in most other languages. If there is a method on a class that you want to replace, you can just use assignment to replace it. This could get the job done for HTTPRequest, HTTPResponse, or, for that matter, for CGIHTTPServer. > > I looked at the code of CGIHTTPServer, but since it supports serveral > platforms, it is not easy to modify. Agreed. That's why simple_server inherits from BaseHTTPServer instead of CGIHTTPSEver.