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

andreas@serenade.digicool.com andreas@serenade.digicool.com
Tue, 3 Jul 2001 14:21:25 -0400


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

Modified Files:
	WebDAVSrcHandler.py 
Log Message:
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



--- Updated File WebDAVSrcHandler.py in package Zope2 --
--- WebDAVSrcHandler.py	2000/12/07 23:57:12	1.2
+++ WebDAVSrcHandler.py	2001/07/03 18:21:25	1.3
@@ -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