[Zope-Checkins] CVS: Zope2 - WebDAVSrcHandler.py:1.2.80.1

andreas@serenade.digicool.com andreas@serenade.digicool.com
Mon, 2 Jul 2001 14:24:42 -0400


Update of /cvs-repository/Zope2/ZServer
In directory serenade:/tmp/cvs-serv22660/ZServer

Modified Files:
      Tag: Zope-2_4-branch
	WebDAVSrcHandler.py 
Log Message:
workaround for buggy webdav implementation in M$ Office 2K



--- Updated File WebDAVSrcHandler.py in package Zope2 --
--- WebDAVSrcHandler.py	2000/12/07 23:57:12	1.2
+++ WebDAVSrcHandler.py	2001/07/02 18:24:41	1.2.80.1
@@ -109,4 +109,18 @@
             if os.sep != '/':
                 path_info = string.replace( path_info, os.sep, '/' )
             env['PATH_INFO'] = path_info
+
+
+        # Workaround for 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
+
+        if string.find(env["HTTP_USER_AGENT"],"Microsoft Data Access Internet Publishing Provider")>-1:
+            if env["PATH_INFO"][-1]=='.':
+                env["PATH_INFO"] = env["PATH_INFO"][:-1]             
+
+            if env["PATH_TRANSLATED"][-1]=='.':
+                env["PATH_TRANSLATED"] = env["PATH_TRANSLATED"][:-1]             
+
         return env