Skip to content
Snippets Groups Projects
Commit 19a10ba7 authored by David Douard's avatar David Douard
Browse files

api/private/read: use application/zip as content_type

for the sake of consistency.
parent 90a5072b
No related branches found
No related tags found
1 merge request!58api/private/read: use application/zip as content_type
...@@ -95,7 +95,7 @@ class SWHDepositReadArchives(SWHPrivateAPIView, SWHGetDepositAPI, ...@@ -95,7 +95,7 @@ class SWHDepositReadArchives(SWHPrivateAPIView, SWHGetDepositAPI,
with aggregate_tarballs(self.extraction_dir, archive_paths) as path: with aggregate_tarballs(self.extraction_dir, archive_paths) as path:
return FileResponse(open(path, 'rb'), return FileResponse(open(path, 'rb'),
status=status.HTTP_200_OK, status=status.HTTP_200_OK,
content_type='application/octet-stream') content_type='application/zip')
class SWHDepositReadMetadata(SWHPrivateAPIView, SWHGetDepositAPI, class SWHDepositReadMetadata(SWHPrivateAPIView, SWHGetDepositAPI,
......
...@@ -36,7 +36,7 @@ def test_access_to_existing_deposit_with_one_archive( ...@@ -36,7 +36,7 @@ def test_access_to_existing_deposit_with_one_archive(
r = authenticated_client.get(url) r = authenticated_client.get(url)
assert r.status_code == status.HTTP_200_OK assert r.status_code == status.HTTP_200_OK
assert r._headers['content-type'][1] == 'application/octet-stream' assert r._headers['content-type'][1] == 'application/zip'
# read the stream # read the stream
data = b''.join(r.streaming_content) data = b''.join(r.streaming_content)
...@@ -76,7 +76,7 @@ def test_access_to_existing_deposit_with_multiple_archives( ...@@ -76,7 +76,7 @@ def test_access_to_existing_deposit_with_multiple_archives(
r = authenticated_client.get(url) r = authenticated_client.get(url)
assert r.status_code == status.HTTP_200_OK assert r.status_code == status.HTTP_200_OK
assert r._headers['content-type'][1] == 'application/octet-stream' assert r._headers['content-type'][1] == 'application/zip'
# read the stream # read the stream
data = b''.join(r.streaming_content) data = b''.join(r.streaming_content)
# extract the file from the zip # extract the file from the zip
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment