Skip to content

Commit f5d2941

Browse files
authored
fix: fetch key-value store records as attachments (#573)
See apify/apify-core#25006 - fetching with `attachment=true` now allows getting unmodified HTML, without the script snippet for disabling cookies. There are no other side effects (except that the response will have `Content-Disposition: attachment`, but that is irrelevant to clients other than web browsers)
1 parent a1f1c99 commit f5d2941

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/apify_client/clients/resource_clients/key_value_store.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def get_record(self, key: str, signature: str | None = None) -> dict | None:
126126
response = self.http_client.call(
127127
url=self._url(f'records/{key}'),
128128
method='GET',
129-
params=self._params(signature=signature),
129+
params=self._params(signature=signature, attachment=True),
130130
)
131131

132132
return {
@@ -181,7 +181,7 @@ def get_record_as_bytes(self, key: str, signature: str | None = None) -> dict |
181181
response = self.http_client.call(
182182
url=self._url(f'records/{key}'),
183183
method='GET',
184-
params=self._params(signature=signature),
184+
params=self._params(signature=signature, attachment=True),
185185
)
186186

187187
return {
@@ -213,7 +213,7 @@ def stream_record(self, key: str, signature: str | None = None) -> Iterator[dict
213213
response = self.http_client.call(
214214
url=self._url(f'records/{key}'),
215215
method='GET',
216-
params=self._params(signature=signature),
216+
params=self._params(signature=signature, attachment=True),
217217
stream=True,
218218
)
219219

@@ -450,7 +450,7 @@ async def get_record(self, key: str, signature: str | None = None) -> dict | Non
450450
response = await self.http_client.call(
451451
url=self._url(f'records/{key}'),
452452
method='GET',
453-
params=self._params(signature=signature),
453+
params=self._params(signature=signature, attachment=True),
454454
)
455455

456456
return {
@@ -505,7 +505,7 @@ async def get_record_as_bytes(self, key: str, signature: str | None = None) -> d
505505
response = await self.http_client.call(
506506
url=self._url(f'records/{key}'),
507507
method='GET',
508-
params=self._params(signature=signature),
508+
params=self._params(signature=signature, attachment=True),
509509
)
510510

511511
return {
@@ -537,7 +537,7 @@ async def stream_record(self, key: str, signature: str | None = None) -> AsyncIt
537537
response = await self.http_client.call(
538538
url=self._url(f'records/{key}'),
539539
method='GET',
540-
params=self._params(signature=signature),
540+
params=self._params(signature=signature, attachment=True),
541541
stream=True,
542542
)
543543

0 commit comments

Comments
 (0)