pkgsrc/www/ap-python/patches/patch-ag
darcy 99afea3af3 As discussed in the mailing list:
Moved to latest version 2.7.8.

Added patch that fixed flags when sending location header.

Added patch to cgihandler to append local directory so that relative URLs
would work.

Added patch to cgihandler to handle SystemExit so that pages would not
ISE when sys.exit(0) was used to exit from the script.

Added patch to break HTTP headers off from page correctly when CRLF and LF
is used inconsistently in a page.
2003-12-03 09:44:10 +00:00

25 lines
976 B
Text

$NetBSD: patch-ag,v 1.1 2003/12/03 09:44:10 darcy Exp $
--- lib/python/mod_python/apache.py.orig 2002-04-19 14:20:40.000000000 -0400
+++ lib/python/mod_python/apache.py
@@ -529,17 +529,9 @@
# are headers over yet?
headers_over = 0
- # first try RFC-compliant CRLF
- ss = string.split(self.headers, '\r\n\r\n', 1)
- if len(ss) < 2:
- # second try with \n\n
- ss = string.split(self.headers, '\n\n', 1)
- if len(ss) >= 2:
- headers_over = 1
- else:
- headers_over = 1
-
- if headers_over:
+ # split the headers from the body.
+ ss = string.split(self.headers.replace('\r\n', '\n'), '\n\n', 1)
+ if len(ss) == 2:
# headers done, process them
string.replace(ss[0], '\r\n', '\n')
lines = string.split(ss[0], '\n')