Roundup Tracker - Issues

Message238

Author anonymous
Recipients
Date 2002-05-29.22:57:12
Message-id
In-reply-to
If a Virtual Host Monster is used, the URL to access
the ZRoundup instance is not it's physical path.  This
patch (against cvs) corrects the behavior :


Index: frontends/ZRoundup/ZRoundup.py
===================================================================
RCS file:
/cvsroot/roundup/roundup/frontends/ZRoundup/ZRoundup.py,v
retrieving revision 1.5
diff -U3 -r1.5 ZRoundup.py
--- frontends/ZRoundup/ZRoundup.py	14 May 2002 23:36:25 -0000	1.5
+++ frontends/ZRoundup/ZRoundup.py	29 May 2002 22:52:33 -0000
@@ -123,8 +123,20 @@
         instance =
roundup.instance.open(self.instance_home)
         request = RequestWrapper(self.REQUEST['RESPONSE'])
         env = self.REQUEST.environ
-        env['SCRIPT_NAME'] =
'/'.join(self.getPhysicalPath()[:-1])
-        env['INSTANCE_NAME'] = self.id
+
+        # figure out the path components to set 
+        # First step: strip off the proto and host
+        path_components = self.absolute_url().split(
'/' )[3:]
+        # special case when roundup is '/' in this
virtual host,
+        if len( path_components ) < 1 :
+            env['SCRIPT_NAME'] = env['INSTANCE_NAME'] = ''
+        else :
+            # all but the last element is the path
+            env['SCRIPT_NAME'] = '/'.join(
path_components[:-1] )
+            # the last element is the name
+            env['INSTANCE_NAME'] = path_components[-1]
+        del path_components
+
         if env['REQUEST_METHOD'] == 'GET':
             # force roundup to re-parse the request
because Zope fiddles
             # with it and we lose all the :filter,
:columns, etc goodness
History
Date User Action Args
2009-02-03 14:20:01adminlinkissue562130 messages
2009-02-03 14:20:01admincreate