fix(svn): fix the problems of reading txn_id when used gunicorn/waitress + traefik/no-traefik combinations
This commit is contained in:
parent
234a3dd25f
commit
2033612a4e
1 changed files with 12 additions and 1 deletions
|
|
@ -605,7 +605,18 @@ class SimpleVCS(object):
|
|||
# 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: str = safe_str(environ['wsgi.input'].getvalue())
|
||||
|
||||
stream = environ['wsgi.input']
|
||||
|
||||
if isinstance(stream, io.BytesIO):
|
||||
data: str = safe_str(stream.getvalue())
|
||||
elif hasattr(stream, 'buf'): # most likely gunicorn.http.body.Body
|
||||
data: str = safe_str(stream.buf.getvalue())
|
||||
else:
|
||||
# fallback to the crudest way, copy the iterator
|
||||
data = safe_str(stream.read())
|
||||
environ['wsgi.input'] = io.BytesIO(safe_bytes(data))
|
||||
|
||||
txn_id = extract_svn_txn_id(self.acl_repo_name, data)
|
||||
|
||||
callback_daemon, extras = self._prepare_callback_daemon(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue