summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fba71cb)
raw | patch | inline | side by side (parent: fba71cb)
author | dman13 <dman13@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 14 Jun 2002 01:25:46 +0000 (01:25 +0000) | ||
committer | dman13 <dman13@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 14 Jun 2002 01:25:46 +0000 (01:25 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@781 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
frontends/ZRoundup/ZRoundup.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 13ec273740ec789e92839fa06f1254bc8260961a..cefb216d5f801b2726daddb1b2ac0ba488acce1c 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- also changed cgi client since it was duplicating the functionality
Fixed:
+ . #558867 ] ZRoundup redirect /instance requests to /instance/
. #562130 ] cookie path generated from ZRoundup was wrong in some situations
. stop sending blank (whitespace-only) notes
. cleanup of serialisation for database storage
index 371719dcec0c2dd1994e5d5c8d250958958f0724..8cd92ab0a3ebb6eb4e69203e3bff56444361bdaf 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: ZRoundup.py,v 1.6 2002-06-12 00:59:44 dman13 Exp $
+# $Id: ZRoundup.py,v 1.7 2002-06-14 01:25:46 dman13 Exp $
#
''' ZRoundup module - exposes the roundup web interface to Zope
QUERY_STRING. Zope interprets the ':' as a special character, and the special
args are lost to it.
'''
+
+import urlparse
+
from Globals import InitializeClass, HTMLFile
from OFS.SimpleItem import Item
from OFS.PropertyManager import PropertyManager
env = self.REQUEST.environ
# figure out the path components to set
- import urlparse
- path = urlparse.urlparse( self.absolute_url() )[2]
- path_components = path.split( '/' )
+ url = urlparse.urlparse( self.absolute_url() )
+ path_components = url[2].split( '/' )
# special case when roundup is '/' in this virtual host,
if path == "/" :
env['SCRIPT_NAME'] = '/'.join( path_components[:-1] )
# the last element is the name
env['INSTANCE_NAME'] = path_components[-1]
- del path_components , path
if env['REQUEST_METHOD'] == 'GET':
# force roundup to re-parse the request because Zope fiddles
form = FormWrapper(self.REQUEST.form)
return instance.Client(instance, request, env, form)
+
security.declareProtected('View', 'index_html')
def index_html(self):
'''Alias index_html to roundup's index
'''
+
+ # Redirect misdirected requests -- bugs 558867 , 565992
+
+ # PATH_INFO, as defined by the CGI spec, has the *real* request path
+ orig_path = self.REQUEST.environ[ 'PATH_INFO' ]
+ if orig_path[-1] != '/' :
+ url = urlparse.urlparse( self.absolute_url() )
+ url = list( url ) # make mutable
+ url[2] = url[2]+'/' # patch
+ url = urlparse.urlunparse( url ) # reassemble
+ RESPONSE = self.REQUEST.RESPONSE
+ RESPONSE.setStatus( "MovedPermanently" ) # 301
+ RESPONSE.setHeader( "Location" , url )
+ return RESPONSE
+
client = self._opendb()
# fake the path that roundup should use
client.split_path = ['index']
#
# $Log: not supported by cvs2svn $
+# Revision 1.6 2002/06/12 00:59:44 dman13
+# Fixed the logic for determing the cookie path. (Closes #562130.)
+#
# Revision 1.5 2002/05/14 23:36:25 richard
# . fixed SCRIPT_NAME in ZRoundup for instances not at top level of Zope
# (thanks dman)