From: Dean M. B. <mik...@gm...> - 2008-09-09 09:22:16
|
On Tue, Sep 9, 2008 at 3:40 PM, Kim Gräsman <kim...@gm...> wrote: > > On Mon, Sep 8, 2008 at 22:12, Kim Gräsman <kim...@gm...> wrote: >> >> On Mon, Sep 8, 2008 at 14:58, Divye Kapoor <div...@gm...> wrote: >>>> >>>> Tab/space separated values work -- they can easily be parsed through >>>> std::ostringstream's -- as well as doing a '\n' delimited lines for >>>> pseudo-CSV. >>> >>> Ok. >> >> I'm currently playing with a HTTP header-style format to echo headers >> for the post tests. >> >> I have a new post_echo_headers.py, that emits the request headers on >> the canonical "name: value\n" form. It gets harder if you want to >> combine headers and other data on the same page, though... > > I've looked into this more closely, and it appears that only selected > headers make it through to the CGI scripts. > > So, as far as I can see there's no reliable way to dump all request > headers to the response from a CGI script, via the Python server. The > ones that make it through are listed in the run_cgi method in Python's > CGIHTTPServer.py. Content-Length and Content-Type are among them, so I > thought I had it working for a while :-/ > Is there no way to define which headers (or if all headers) should be preserved? > Grr. That should be alright... We may find a better way to go about things if we write our own HTTPServer extension which does what we want instead of relying on the CGIHTTPServer that Python defines. I don't have enough Python kung fu to be able to pull it off yet though so if you find other ways, I'm all ears. ;-) Thanks for looking into this! :-D -- Dean Michael C. Berris Software Engineer, Friendster, Inc. |