diff --git a/rhodecode/lib/middleware/simplevcs.py b/rhodecode/lib/middleware/simplevcs.py --- a/rhodecode/lib/middleware/simplevcs.py +++ b/rhodecode/lib/middleware/simplevcs.py @@ -599,13 +599,13 @@ class SimpleVCS(object): also handles the locking exceptions which will be triggered when the first chunk is produced by the underlying WSGI application. """ + txn_id = '' if 'CONTENT_LENGTH' in environ and environ['REQUEST_METHOD'] == 'MERGE': # case for SVN, we want to re-use the callback daemon port # so we use the txn_id, for this we peek the body, and still save # it as wsgi.input - data = environ['wsgi.input'].read() - environ['wsgi.input'] = io.StringIO(data) + data: str = safe_str(environ['wsgi.input'].getvalue()) txn_id = extract_svn_txn_id(self.acl_repo_name, data) callback_daemon, extras = self._prepare_callback_daemon(