Commit Graph

43 Commits

Author SHA1 Message Date
Gregory P. Smith 4bd76641b8 docstring update. 2009-05-03 20:27:25 +00:00
Gregory P. Smith 923ba361d8 - Issue #2254: Fix CGIHTTPServer information disclosure. Relative paths are
now collapsed within the url properly before looking in cgi_directories.
2009-04-06 06:33:26 +00:00
Georg Brandl 4ed9be733b #3345: fix docstring. 2008-07-16 22:09:17 +00:00
Collin Winter 83b2bf6d9a Patch #1481079: Support of HTTP_REFERER in CGIHTTPServer.py 2007-03-09 03:15:56 +00:00
Tim Peters f733abb783 Whitespace normalization. 2007-01-30 03:03:46 +00:00
Andrew M. Kuchling b29069d6b6 [Bug #737202; fix from Titus Brown] Make CGIHTTPServer work for scripts in sub-directories 2006-12-22 13:25:02 +00:00
Jeremy Hylton 6414cd8717 SF patch #1055159 via Titus Brown: Document redirect limitation.
Bug fix candidate.
2004-12-22 14:19:09 +00:00
Martin v. Löwis a28b3e6dfb Patch #727483: Add AUTH_TYPE and REMOTE_USER. 2004-08-29 16:53:26 +00:00
Guido van Rossum 70ec0b42b5 Fix for SF 777848.
I've been bitten by this myself in the past half year.
I hope this fix is right.
I'll backport this to 2.3.
2004-03-20 22:18:03 +00:00
Tim Peters 27f49610af SF patch 508730 CGIHTTPServer execfile should save cwd
UNTESTED!!!

This simple two-line patch has been sitting on SF for more than 2 years.
I'm guessing it's because nobody knows how to test it -- I sure don't.
It doesn't look like you can get to this part of the code on Unixish
or Windows systems, so the "how to test it?" puzzle has more than one
part.  OTOH, if this is dead code, it doesn't matter either if I just
broke it <wink>.
2004-03-20 21:51:12 +00:00
Walter Dörwald 70a6b49821 Replace backticks with repr() or "%r"
From SF patch #852334.
2004-02-12 17:35:32 +00:00
Raymond Hettinger 92f200b569 SF bug #770601: CGIHTTPServer and environment variables (bug + solution)
(contributed by Vincent Delft.)

The script updated os.environ but failed to pass the whole environment
to the child process (the CGI script).
2003-07-14 06:56:32 +00:00
Raymond Hettinger e2f18377ff SF bug #430160: CGIHTTPServer.py POST bug using IE
Minor improvement to previous bugfix.
Eating the remaining characters would lead to an endless loop
without a termination test.
2003-06-29 05:06:56 +00:00
Steve Holden 8a978f7cde Fix bug 427345 [related to IE's additional input on POST request]. 2003-01-08 18:53:18 +00:00
Guido van Rossum b390315872 Must catch TypeError from int(length). 2002-10-17 16:21:35 +00:00
Guido van Rossum e3ec296df8 Typo repair. Please include in any backports. 2002-08-20 20:07:10 +00:00
Guido van Rossum 0bd7832285 SF patch 595846 by Brett Cannon: Update environ for CGIHTTPServer.py
This patch causes CGIHTTPServer to update os.environ regardless of how
it tries to handle calls (fork, popen*, etc.).

Backport bugfix candidate.
2002-08-20 19:55:06 +00:00
Guido van Rossum b54c27c861 Fix for SF bug 570678 (can't flush read-only file on Mac OS X). 2002-08-01 21:12:35 +00:00
Raymond Hettinger 32200aeac6 Replaced obsolete stat module constants with equivalent attributes 2002-06-01 19:51:15 +00:00
Guido van Rossum 8ca162f417 Partial introduction of bools where appropriate. 2002-04-07 06:36:23 +00:00
Tim Peters bc0e910826 Convert a pile of obvious "yes/no" functions to return bool. 2002-04-04 22:55:58 +00:00
Skip Montanaro 3c643d8db3 tighten up except - int() only raises ValueError 2002-03-23 05:47:31 +00:00
Guido van Rossum 8cb6540652 Wesley Chun's SF patch 511380: add CGIHTTPServer error supt for Win32
This uses os.popen3 (if it exists) to ensure that errors from a
non-Python CGI script are logged.

Bugfix candidate.
2002-02-01 16:27:59 +00:00
Guido van Rossum 0afde13b43 Fix two typos, one noted by Noah Spurrier in SF bug #475166, the
second noted after a second's thought about what the next line should
do. :-(
2001-10-26 03:38:46 +00:00
Guido van Rossum bcbdc95e90 SF patch #467430.
- replace some log_error() calls with log_message()

- flush self.rfile before forking too (hope this works on Windows)
2001-10-17 06:45:56 +00:00
Guido van Rossum 16fd3381d4 Apply two small changes to the Windows code, according to SF bug
#427345.  These are supposed to support binary data and avoid
buffering problems on Windows.
2001-08-07 19:55:10 +00:00
Eric S. Raymond 7e642e82d3 Eliminate use of string.whitespace and a string import with it.
Some of the characters (form feed, vertical tab) are not
legal continuation characters anyway, so this was wrong as
well as annoying.
2001-02-09 12:10:26 +00:00
Eric S. Raymond 6b71e747b1 String method conversion. 2001-02-09 08:56:30 +00:00
Skip Montanaro e99d5ea25b added __all__ lists to a number of Python modules
added test script and expected output file as well
this closes patch 103297.
__all__ attributes will be added to other modules without first submitting
a patch, just adding the necessary line to the test script to verify
more-or-less correct implementation.
2001-01-20 19:54:20 +00:00
Guido van Rossum e7d6b0a22e An honest attempt to make this work on Unix, Windows, and even
Macintosh (the latter untested).

This closes Bug #110839.
2000-09-19 04:01:01 +00:00
Guido van Rossum 6aefd91c7f Now that StreamRequestHandler defaults rfile to buffered, make it
unbuffered (by setting the class variable rbufsize to 0), because we
(may) need to pass the file descriptor to the subprocess running the
CGI script positioned after the headers.
2000-09-01 03:27:34 +00:00
Fred Drake 14bb71d553 os.fork raises AttributeError, not NameError, if fork() isn't
supported.  Pointed out by Moshe Zadka <moshez@math.huji.ac.il>.
1999-10-18 13:43:44 +00:00
Fred Drake 40e84db0f4 Based on comments from Paul Prescod:
If os.fork() doesn't exist, raise SystemError with an explanation at
the top of the module.  Added a note to the module docstring.
1999-10-16 02:07:50 +00:00
Guido van Rossum 3a64e058eb No need to import sys, time, or socket. (Andrew Dalke & kjpylint) 1999-05-03 18:00:48 +00:00
Guido van Rossum 630b811676 Two changes suggested by Jan Pieter Riegel:
(1) Fix reference to pwd.error to be KeyError -- there is no pwd.error
and pwd.getpwnam() raises KeyError on failure.

(2) Add cookie support, by placing the 'Cookie:' header, if present,
in the HTTP_COOKIE environment variable.
1999-04-28 12:21:47 +00:00
Guido van Rossum 9228cbd084 Patch by Jeff Rush:
In CGIHTTPServer.py, the list of acceptable formats is -split-
on spaces but -joined- on commas, resulting in double commas
in the joined text.  It appears harmless to my browser but
ought to be fixed anyway.

    'A, B, C' -> 'A,', 'B,', 'C,' -> 'A,,B,,C'
1998-12-07 04:08:03 +00:00
Guido van Rossum 01fc65d92f From: conrad@cgl.ucsf.edu (Conrad Huang %CGL)
To: python-list@cwi.nl
Date: 13 May 98 18:33:11 GMT

I think I found a bug in CGIHTTPServer.py.  (Does anyone care? :-)
I was trying to use it as the web server for uploading files.
Python CGI scripts (using the CGI module) that worked for other
servers (e.g., Netscape Enterprise server) hang when run from
CGIHTTPServer.  The problem is that the content type parameters,
in particular the boundary parameter, were not passed through to
the CGI scripts, thus making the MIME parsing code choke.

My simple-minded fix is:

	% diff CGIHTTPServer.py /usr/local/lib/python1.5/CGIHTTPServer.py
	137,140c136
	<           if self.headers.typeheader is None:
	<               env['CONTENT_TYPE'] = self.headers.type
	<           else:
	<               env['CONTENT_TYPE'] = self.headers.typeheader
	---
	>           env['CONTENT_TYPE'] = self.headers.type

Conrad
1998-05-13 20:13:24 +00:00
Guido van Rossum 45e2fbc2e7 Mass check-in after untabifying all files that need it. 1998-03-26 21:13:24 +00:00
Guido van Rossum 00f9fea288 Use string.replace instead of regsub.[g]sub. 1997-12-24 21:18:41 +00:00
Guido van Rossum 78016145d6 Remove some bogus code that would cause a NameError if a -r option was passed. 1997-02-19 20:07:38 +00:00
Guido van Rossum 13ad35a7d6 real test for executable script 1996-01-25 18:23:50 +00:00
Guido van Rossum 92d0932025 changed some commas into percent signs 1995-08-29 19:18:24 +00:00
Guido van Rossum e7e578ffe0 Initial revision 1995-08-04 04:00:20 +00:00