##// END OF EJS Templates
svn: escape special chars to allow interactions with non-standard svn paths....
marcink -
r1586:23640ce6 default
parent child Browse files
Show More
@@ -19,8 +19,10 b''
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21 import logging
21 import logging
22 import urllib
22 from urlparse import urljoin
23 from urlparse import urljoin
23
24
25
24 import requests
26 import requests
25 from webob.exc import HTTPNotAcceptable
27 from webob.exc import HTTPNotAcceptable
26
28
@@ -55,6 +57,14 b' class SimpleSvnApp(object):'
55 environ['REQUEST_METHOD'], self._get_url(environ['PATH_INFO']),
57 environ['REQUEST_METHOD'], self._get_url(environ['PATH_INFO']),
56 data=data, headers=request_headers)
58 data=data, headers=request_headers)
57
59
60 if response.status_code not in [200, 401]:
61 if response.status_code >= 500:
62 log.error('Got SVN response:%s with text:`%s`',
63 response, response.text)
64 else:
65 log.debug('Got SVN response:%s with text:`%s`',
66 response, response.text)
67
58 response_headers = self._get_response_headers(response.headers)
68 response_headers = self._get_response_headers(response.headers)
59 start_response(
69 start_response(
60 '{} {}'.format(response.status_code, response.reason),
70 '{} {}'.format(response.status_code, response.reason),
@@ -62,8 +72,10 b' class SimpleSvnApp(object):'
62 return response.iter_content(chunk_size=1024)
72 return response.iter_content(chunk_size=1024)
63
73
64 def _get_url(self, path):
74 def _get_url(self, path):
65 return urljoin(
75 url_path = urljoin(
66 self.config.get('subversion_http_server_url', ''), path)
76 self.config.get('subversion_http_server_url', ''), path)
77 url_path = urllib.quote(url_path, safe="/:=~+!$,;'")
78 return url_path
67
79
68 def _get_request_headers(self, environ):
80 def _get_request_headers(self, environ):
69 headers = {}
81 headers = {}
General Comments 0
You need to be logged in to leave comments. Login now