# HG changeset patch # User RhodeCode Admin # Date 2024-10-16 07:45:34 # Node ID b90185f7a7908eea09be72800ad47c7f8ec089f3 # Parent f3356a6625e8aaf91aaa42295a1ecc06c1a62273 chore(code): small code improvements logging & stricter header checks diff --git a/rhodecode/lib/middleware/utils/scm_app_http.py b/rhodecode/lib/middleware/utils/scm_app_http.py --- a/rhodecode/lib/middleware/utils/scm_app_http.py +++ b/rhodecode/lib/middleware/utils/scm_app_http.py @@ -167,7 +167,8 @@ def _is_request_chunked(environ): def _maybe_stream_request(environ): path = get_path_info(environ) stream = _is_request_chunked(environ) - log.debug('handling request `%s` with stream support: %s', path, stream) + req_method = environ['REQUEST_METHOD'] + log.debug('handling scm request: %s `%s` with stream support: %s', req_method, path, stream) if stream: # set stream by 256k diff --git a/rhodecode/model/update.py b/rhodecode/model/update.py --- a/rhodecode/model/update.py +++ b/rhodecode/model/update.py @@ -42,7 +42,7 @@ class UpdateModel(BaseModel): ver = rhodecode.__version__ log.debug('Checking for upgrade on `%s` server', update_url) opener = urllib.request.build_opener() - opener.addheaders = [('User-agent', 'RhodeCode-SCM/%s' % ver)] + opener.addheaders = [('User-agent', f'RhodeCode-SCM/{ver.strip()}')] response = opener.open(update_url) response_data = response.read() data = json.loads(response_data)