[Zope-Checkins] CVS: Zope/ZServer - WebDAVSrcHandler.py:1.6.26.1

Andreas Jung andreas@zope.com
Wed, 7 Nov 2001 15:54:38 -0500


Update of /cvs-repository/Zope/ZServer
In directory cvs.zope.org:/tmp/cvs-serv21145

Modified Files:
      Tag: ajung-webdav-debug
	WebDAVSrcHandler.py 
Log Message:
hack-for-the-hack: because the standard HTTP server modifies 
PATH_INFO WebDAV source GET requests on the standard HTTP port,
we should not modify PATH_INFO twice *sigh*



=== Zope/ZServer/WebDAVSrcHandler.py 1.6 => 1.6.26.1 ===
         # Set a flag to indicate this request came through the WebDAV source
         # port server.
-        env['WEBDAV_SOURCE_PORT'] = 1
         
-        if env['REQUEST_METHOD'] == 'GET':
-            path_info = env['PATH_INFO']
-            path_info = os.path.join( path_info, 'manage_FTPget' )
-            path_info = os.path.normpath( path_info )
-            if os.sep != '/':
-                path_info =  path_info.replace( os.sep, '/' )
-            env['PATH_INFO'] = path_info
+        # Note: due to the source-port hack to GET the source of a document
+        # also from the HTTP server, we must check if the HTTP server has
+        # already modified the PATH_INFO 
 
+        if not env.get('WEBDAV_SOURCE_PORT',0):
+            env['WEBDAV_SOURCE_PORT'] = 1
+            
+            if env['REQUEST_METHOD'] == 'GET':
+                path_info = env['PATH_INFO']
+                path_info = os.path.join( path_info, 'manage_FTPget' )
+                path_info = os.path.normpath( path_info )
+                if os.sep != '/':
+                    path_info =  path_info.replace( os.sep, '/' )
+                env['PATH_INFO'] = path_info
 
-        # Workaround for lousy WebDAV implementation of M$ Office 2K.
+
+        # Workaround for the lousy WebDAV implementation of M$ Office 2K.
         # Requests for "index_html" are *sometimes* send as "index_html."
         # We check the user-agent and remove a trailing dot for PATH_INFO
         # and PATH_TRANSLATED