summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f33816f)
raw | patch | inline | side by side (parent: f33816f)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 16 Sep 2002 22:37:26 +0000 (22:37 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 16 Sep 2002 22:37:26 +0000 (22:37 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1181 57a73879-2fb5-44c3-a270-3262357dd7e2
diff --git a/CHANGES.txt b/CHANGES.txt
index d177817176134df3ac0dcdefce2a7343c7b077c8..35168b8e8a77eadf3c51376944ebbcf0b25c6a95 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
. registration error punts back to register page
. gadfly backend now handles changes to the schema - but only one property
at a time
+ . cgi.client base URL is now obtained from the config TRACKER_WEB
+ . request.url has gone away - there's too much magic in trying to figure
+ what it should be
+ . cgi-bin script redirects to https now if the request was https
2002-09-13 0.5.0 beta2
diff --git a/TODO.txt b/TODO.txt
index 6122bfee1cf35885083dfa864089102aad7bfda0..4228c9e36776c32c84d90be058a5bd3e89c61edd 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
pending web allow multilink selections to select a "none" element to allow
people with broken browsers to select nothing?
-bug web request.url is incorrect in cgi-bin environments
bug web do something about file.newitem
bug mailgw some f*ked mailers QUOTE their Re; "Re: "[issue1] bla blah""
bug docs need to mention somewhere how sorting works
diff --git a/cgi-bin/roundup.cgi b/cgi-bin/roundup.cgi
index 80327052e867cefc34acf26055bcda5b595e18cf..2fb844dc4aeac30ca6aab67f58b70c352d93a374 100755 (executable)
--- a/cgi-bin/roundup.cgi
+++ b/cgi-bin/roundup.cgi
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: roundup.cgi,v 1.31 2002-09-10 03:01:17 richard Exp $
+# $Id: roundup.cgi,v 1.32 2002-09-16 22:37:26 richard Exp $
# python version check
from roundup import version_check
# redirect if we need a trailing '/'
if len(path) == 2:
request.send_response(301)
- absolute_url = 'http://%s%s/'%(os.environ['HTTP_HOST'],
+ # redirect
+ if os.environ.get('HTTPS', '') == 'on':
+ protocol = 'https'
+ else:
+ protocol = 'http'
+ absolute_url = '%s://%s%s/'%(protocol, os.environ['HTTP_HOST'],
os.environ['REQUEST_URI'])
request.send_header('Location', absolute_url)
request.end_headers()
diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py
index c7a2e79c7cba6a9190c21781542e5e7e24d232bd..831ac7a7f6860734523ce3a846000dd6e661dd36 100644 (file)
--- a/roundup/cgi/client.py
+++ b/roundup/cgi/client.py
-# $Id: client.py,v 1.36 2002-09-16 06:39:12 richard Exp $
+# $Id: client.py,v 1.37 2002-09-16 22:37:26 richard Exp $
__doc__ = """
WWW request handler (also used in the stand-alone server).
keeps the nodeid of the session as the "session" attribute.
Client attributes:
- "url" is the current url path
- "path" is the PATH_INFO inside the instance
+ "path" is the PATH_INFO inside the instance (with no leading '/')
"base" is the base URL for the instance
'''
self.request = request
self.env = env
+ # save off the path
self.path = env['PATH_INFO']
- self.split_path = self.path.split('/')
- self.instance_path_name = env['TRACKER_NAME']
# this is the base URL for this instance
- url = self.env['SCRIPT_NAME'] + '/' + self.instance_path_name
- self.base = urlparse.urlunparse(('http', env['HTTP_HOST'], url,
- None, None, None))
-
- # request.path is the full request path
- x, x, path, x, x, x = urlparse.urlparse(request.path)
- self.url = urlparse.urlunparse(('http', env['HTTP_HOST'], path,
- None, None, None))
+ self.base = self.instance.config.TRACKER_WEB
+ # see if we need to re-parse the environment for the form (eg Zope)
if form is None:
self.form = cgi.FieldStorage(environ=env)
else:
self.form = form
- self.headers_done = 0
+
+ # turn debugging on/off
try:
self.debug = int(env.get("ROUNDUP_DEBUG", 0))
except ValueError:
# someone gave us a non-int debug level, turn it off
self.debug = 0
+ # flag to indicate that the HTTP headers have been sent
+ self.headers_done = 0
+
# additional headers to send with the request - must be registered
# before the first write
self.additional_headers = {}
self.nodeid = None
# determine the classname and possibly nodeid
- path = self.split_path
+ path = self.path.split('/')
if not path or path[0] in ('', 'home', 'index'):
if self.form.has_key(':template'):
self.template = self.form[':template'].value
index 2561b2ba0d9274da95b3fcd63669178aa9907cca..465a4038e5b4eaeaf94421d0c81fcabe1964bc53 100644 (file)
"form" the CGI form as a cgi.FieldStorage
"env" the CGI environment variables
- "url" the current URL path for this request
"base" the base URL for this instance
"user" a HTMLUser instance for this user
"classname" the current classname (possibly None)
self.form = client.form
self.env = client.env
self.base = client.base
- self.url = client.url
self.user = HTMLUser(client, 'user', client.userid)
# store the current class name and action