Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
On Thursday, 7th July from 1 to 3 pm there will be a maintenance with a short downtime of GitLab.
Open sidebar
nomad-lab
nomad-FAIR
Commits
5121e9ab
Commit
5121e9ab
authored
Jan 05, 2021
by
Markus Scheidgen
Browse files
Change the content type based on the given format parameter.
parent
2f661aab
Changes
2
Show whitespace changes
Inline
Side-by-side
nomad/app/dcat/catalog.py
View file @
5121e9ab
...
...
@@ -73,7 +73,8 @@ class Catalog(Resource):
mapping
=
Mapping
()
mapping
.
map_catalog
(
es_response
.
hits
)
content_type
=
'application/xml'
if
format_
==
'xml'
else
'text/%s'
%
format_
return
Response
(
mapping
.
g
.
serialize
(
format
=
format_
).
decode
(
'utf-8'
),
200
,
{
'Content-Type'
:
'application/xml'
})
{
'Content-Type'
:
content_type
})
nomad/app/dcat/datasets.py
View file @
5121e9ab
...
...
@@ -59,6 +59,7 @@ class Dataset(Resource):
mapping
=
Mapping
()
mapping
.
map_entry
(
entry
)
content_type
=
'application/xml'
if
format_
==
'xml'
else
'text/%s'
%
format_
return
Response
(
mapping
.
g
.
serialize
(
format
=
format_
).
decode
(
'utf-8'
),
200
,
{
'Content-Type'
:
'application/xml'
})
{
'Content-Type'
:
content_type
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment