svn: extend detection of SVN to PROPFIND/PROPATCH methods.

- in some cases like usage of tortoisesvn non of the available SVN
protocol detection methods are available
- with extended method we're able to catch directory delete/create
This commit is contained in:
Marcin Kuzminski 2017-11-27 18:51:25 +01:00
parent 245d213bf2
commit 539e88e6c6

View file

@ -76,12 +76,15 @@ def is_svn(environ):
"""
Returns True if requests target is Subversion server
"""
http_dav = environ.get('HTTP_DAV', '')
magic_path_segment = rhodecode.CONFIG.get(
'rhodecode_subversion_magic_path', '/!svn')
is_svn_path = (
'subversion' in http_dav or
magic_path_segment in environ['PATH_INFO'])
magic_path_segment in environ['PATH_INFO']
or environ['REQUEST_METHOD'] in ['PROPFIND', 'PROPPATCH']
)
log.debug(
'request path: `%s` detected as SVN PROTOCOL %s', environ['PATH_INFO'],
is_svn_path)