Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-deposit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Platform
Development
swh-deposit
Commits
19a10ba7
Commit
19a10ba7
authored
5 years ago
by
David Douard
Browse files
Options
Downloads
Patches
Plain Diff
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
!58
api/private/read: use application/zip as content_type
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
swh/deposit/api/private/deposit_read.py
+1
-1
1 addition, 1 deletion
swh/deposit/api/private/deposit_read.py
swh/deposit/tests/api/test_deposit_private_read_archive.py
+2
-2
2 additions, 2 deletions
swh/deposit/tests/api/test_deposit_private_read_archive.py
with
3 additions
and
3 deletions
swh/deposit/api/private/deposit_read.py
+
1
−
1
View file @
19a10ba7
...
@@ -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
,
...
...
This diff is collapsed.
Click to expand it.
swh/deposit/tests/api/test_deposit_private_read_archive.py
+
2
−
2
View file @
19a10ba7
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment