vcs: added headers into stream call too

This commit is contained in:
RhodeCode Admin 2023-02-03 10:35:08 +01:00
parent 455020bf4a
commit 84412730da

View file

@ -106,7 +106,11 @@ def _remote_call(url, payload, exceptions_map, session):
def _streaming_remote_call(url, payload, exceptions_map, session, chunk_size):
try:
response = session.post(url, data=msgpack.packb(payload))
headers = {
'X-RC-Method': payload.get('method'),
'X-RC-Repo-Name': payload.get('_repo_name')
}
response = session.post(url, data=msgpack.packb(payload), headers=headers)
except pycurl.error as e:
msg = '{}. \npycurl traceback: {}'.format(e, traceback.format_exc())
raise exceptions.HttpVCSCommunicationError(msg)