[FIX] webdav in /webdav
bzr revid: al@openerp.com-20110930093749-5ij7tvj9lc7lhztc
This commit is contained in:
parent
c39513038a
commit
c20bd2b2f8
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue