fix(observatory): disable source artifact compression

This commit is contained in:
DCCONSTRUCTIONS
2026-08-31 18:05:34 +03:00
parent 4cd94b5805
commit 7e59176581
2 changed files with 158 additions and 4 deletions
@@ -502,7 +502,10 @@ class ObservatoryWorkerHttpGateway(ObservatoryWorkerTransport):
with self._client.stream(
"GET",
self._job_path(job.job_id, "source-camera-epoch-archive"),
headers=self._claim_headers(context),
headers={
**self._claim_headers(context),
"Accept-Encoding": "identity",
},
timeout=httpx.Timeout(
connect=self._timeout_seconds,
read=WORKER_HTTP_CAMERA_ARCHIVE_READ_TIMEOUT_SECONDS,
@@ -513,6 +516,14 @@ class ObservatoryWorkerHttpGateway(ObservatoryWorkerTransport):
if response.status_code == 404:
return
self._raise_for_status(response)
content_encoding = response.headers.get("content-encoding")
if (
content_encoding is not None
and content_encoding.lower() != "identity"
):
raise ObservatoryWorkerHttpError(
"camera epoch archive content encoding changed"
)
if (
response.headers.get("content-type")
!= PORTABLE_CAMERA_EPOCH_ARCHIVE_MEDIA_TYPE
@@ -620,9 +631,20 @@ class ObservatoryWorkerHttpGateway(ObservatoryWorkerTransport):
with self._client.stream(
"GET",
self._job_path(job_id, f"source-members/{member.member_id}"),
headers=self._claim_headers(context),
headers={
**self._claim_headers(context),
"Accept-Encoding": "identity",
},
) as response:
self._raise_for_status(response)
content_encoding = response.headers.get("content-encoding")
if (
content_encoding is not None
and content_encoding.lower() != "identity"
):
raise ObservatoryWorkerHttpError(
"source member content encoding changed"
)
declared = response.headers.get("content-length")
if declared is not None and declared != str(member.byte_length):
raise ObservatoryWorkerHttpError(