Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (4)
dakweb: set Content-Type to text/json where appropriate
· ee02cab4
Ansgar
authored
Sep 18, 2018
ee02cab4
madison.py: include charset in Content-Type for text/plain response
· d058c3b0
Ansgar
authored
Sep 18, 2018
d058c3b0
dakweb/queries/*.py: do not make files executable
· eb8f043d
Ansgar
authored
Sep 18, 2018
eb8f043d
Merge remote-tracking branch 'ansgar/dakweb-content-type'
· f78f3b7e
Ansgar
authored
Sep 18, 2018
f78f3b7e
Show whitespace changes
Inline
Side-by-side
dakweb/queries/archive.py
100755 → 100644
View file @
f78f3b7e
#!/usr/bin/python
"""
Archive related queries
@contact: Debian FTPMaster <ftpmaster@debian.org>
...
...
@@ -33,6 +31,7 @@ def archives():
s
.
close
()
bottle
.
response
.
content_type
=
'
application/json; charset=UTF-8
'
return
json
.
dumps
(
ret
)
QueryRegister
().
register_path
(
'
/archives
'
,
archives
)
dakweb/queries/binary.py
View file @
f78f3b7e
...
...
@@ -28,6 +28,7 @@ def binary_metadata_keys():
s
.
close
()
bottle
.
response
.
content_type
=
'
application/json; charset=UTF-8
'
return
json
.
dumps
(
ret
)
QueryRegister
().
register_path
(
'
/metadata_keys
'
,
binary_metadata_keys
)
...
...
@@ -67,6 +68,7 @@ def binary_by_metadata(key=None):
'
metadata_value
'
:
p
.
value
})
s
.
close
()
bottle
.
response
.
content_type
=
'
application/json; charset=UTF-8
'
return
json
.
dumps
(
ret
)
QueryRegister
().
register_path
(
'
/binary/by_metadata
'
,
binary_by_metadata
)
dakweb/queries/madison.py
View file @
f78f3b7e
...
...
@@ -61,11 +61,12 @@ def madison():
result
=
list_packages
(
packages
,
**
kwargs
)
if
format
is
None
:
bottle
.
response
.
content_type
=
'
text/plain
'
bottle
.
response
.
content_type
=
'
text/plain
; charset=UTF-8
'
for
row
in
result
:
yield
row
yield
"
\n
"
else
:
bottle
.
response
.
content_type
=
'
application/json; charset=UTF-8
'
yield
json
.
dumps
(
list
(
result
))
...
...
dakweb/queries/source.py
100755 → 100644
View file @
f78f3b7e
...
...
@@ -57,6 +57,7 @@ def dsc_in_suite(suite=None, source=None):
s
.
close
()
bottle
.
response
.
content_type
=
'
application/json; charset=UTF-8
'
return
json
.
dumps
(
ret
)
QueryRegister
().
register_path
(
'
/dsc_in_suite
'
,
dsc_in_suite
)
...
...
@@ -100,6 +101,7 @@ def file_in_archive(filepattern=None):
s
.
close
()
bottle
.
response
.
content_type
=
'
application/json; charset=UTF-8
'
return
json
.
dumps
(
ret
)
QueryRegister
().
register_path
(
'
/file_in_archive
'
,
file_in_archive
)
...
...
@@ -136,6 +138,7 @@ def sha256sum_in_archive(sha256sum=None):
s
.
close
()
bottle
.
response
.
content_type
=
'
application/json; charset=UTF-8
'
return
json
.
dumps
(
ret
)
QueryRegister
().
register_path
(
'
/sha256sum_in_archive
'
,
sha256sum_in_archive
)
...
...
@@ -196,6 +199,7 @@ def all_sources():
s
.
close
()
bottle
.
response
.
content_type
=
'
application/json; charset=UTF-8
'
return
json
.
dumps
(
ret
)
QueryRegister
().
register_path
(
'
/all_sources
'
,
all_sources
)
dakweb/queries/suite.py
View file @
f78f3b7e
...
...
@@ -48,6 +48,7 @@ def suites():
s
.
close
()
bottle
.
response
.
content_type
=
'
application/json; charset=UTF-8
'
return
json
.
dumps
(
ret
)
QueryRegister
().
register_path
(
'
/suites
'
,
suites
)
...
...
@@ -115,6 +116,7 @@ def suite(suite=None):
s
.
close
()
bottle
.
response
.
content_type
=
'
application/json; charset=UTF-8
'
return
json
.
dumps
(
so
)
QueryRegister
().
register_path
(
'
/suite
'
,
suite
)