From c20bd2b2f8fe1828690d1a65329b0ca157d83ad8 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Fri, 30 Sep 2011 11:37:49 +0200 Subject: [PATCH] [FIX] webdav in /webdav bzr revid: al@openerp.com-20110930093749-5ij7tvj9lc7lhztc --- openerp/wsgi.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/openerp/wsgi.py b/openerp/wsgi.py index e5aa378bf04..3b66cc2a64c 100644 --- a/openerp/wsgi.py +++ b/openerp/wsgi.py @@ -144,17 +144,18 @@ def wsgi_jsonrpc(environ, start_response): pass def wsgi_webdav(environ, start_response): - if environ['REQUEST_METHOD'] == 'OPTIONS' and environ['PATH_INFO'] == '*': + pi = environ['PATH_INFO'] + if environ['REQUEST_METHOD'] == 'OPTIONS' and pi in ['*','/']: return return_options(environ, start_response) - - http_dir = websrv_lib.find_http_service(environ['PATH_INFO']) - if http_dir: - path = environ['PATH_INFO'][len(http_dir.path):] - if path.startswith('/'): - environ['PATH_INFO'] = path - else: - environ['PATH_INFO'] = '/' + path - return http_to_wsgi(http_dir)(environ, start_response) + elif pi.startswith('/webdav'): + http_dir = websrv_lib.find_http_service(pi) + if http_dir: + path = pi[len(http_dir.path):] + if path.startswith('/'): + environ['PATH_INFO'] = path + else: + environ['PATH_INFO'] = '/' + path + return http_to_wsgi(http_dir)(environ, start_response) def return_options(environ, start_response): # Microsoft specific header, see