# HG changeset patch # User RhodeCode Admin # Date 2023-11-23 09:19:44 # Node ID 2548bbeb673fdc02abadced9c15ed7711471eb28 # Parent 919dd05c664b65a1b48264ad63248a4c3b3bdbf9 fix(svn): fixed txn_id extraction from the data buffer. - This buffer is always BYTES - use new python3 getvalue that can get the data and not exhaust the iterator - fixes # 5707 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(