##// END OF EJS Templates
core: optimize some calls to skip license/scm detection on them
milka -
r4655:009d312e default
parent child Browse files
Show More
@@ -161,15 +161,28 b' def detect_vcs_request(environ, backends'
161 # List of path views first chunk we don't do any checks
161 # List of path views first chunk we don't do any checks
162 white_list = [
162 white_list = [
163 # e.g /_file_store/download
163 # e.g /_file_store/download
164 '_file_store'
164 '_file_store',
165
166 # static files no detection
167 '_static',
168
169 # full channelstream connect should be VCS skipped
170 '_admin/channelstream/connect',
165 ]
171 ]
166
172
167 path_info = environ['PATH_INFO']
173 path_info = environ['PATH_INFO']
168
174
169 if get_path_elem(path_info) in white_list:
175 path_elem = get_path_elem(path_info)
176
177 if path_elem in white_list:
170 log.debug('path `%s` in whitelist, skipping...', path_info)
178 log.debug('path `%s` in whitelist, skipping...', path_info)
171 return handler
179 return handler
172
180
181 path_url = path_info.lstrip('/')
182 if path_url in white_list:
183 log.debug('full url path `%s` in whitelist, skipping...', path_url)
184 return handler
185
173 if VCS_TYPE_KEY in environ:
186 if VCS_TYPE_KEY in environ:
174 raw_type = environ[VCS_TYPE_KEY]
187 raw_type = environ[VCS_TYPE_KEY]
175 if raw_type == VCS_TYPE_SKIP:
188 if raw_type == VCS_TYPE_SKIP:
@@ -181,7 +194,7 b' def detect_vcs_request(environ, backends'
181 log.debug('got handler:%s from environ', handler)
194 log.debug('got handler:%s from environ', handler)
182
195
183 if not handler:
196 if not handler:
184 log.debug('request start: checking if request is of VCS type in order: %s', backends)
197 log.debug('request start: checking if request for `%s` is of VCS type in order: %s', path_elem, backends)
185 for vcs_type in backends:
198 for vcs_type in backends:
186 vcs_check, _handler = checks[vcs_type]
199 vcs_check, _handler = checks[vcs_type]
187 if vcs_check(environ):
200 if vcs_check(environ):
General Comments 0
You need to be logged in to leave comments. Login now