[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Git][ftp-team/dak][master] 4 commits: dakweb: set Content-Type to text/json where appropriate



Title: GitLab

Ansgar Burchardt pushed to branch master at Debian FTP Team / dak

Commits:

5 changed files:

Changes:

  • dakweb/queries/archive.py
    1
    -#!/usr/bin/python
    
    2
    -
    
    3 1
     """ Archive related queries
    
    4 2
     
    
    5 3
     @contact: Debian FTPMaster <ftpmaster@debian.org>
    
    ... ... @@ -33,6 +31,7 @@ def archives():
    33 31
     
    
    34 32
         s.close()
    
    35 33
     
    
    34
    +    bottle.response.content_type = 'application/json; charset=UTF-8'
    
    36 35
         return json.dumps(ret)
    
    37 36
     
    
    38 37
     QueryRegister().register_path('/archives', archives)

  • dakweb/queries/binary.py
    ... ... @@ -28,6 +28,7 @@ def binary_metadata_keys():
    28 28
     
    
    29 29
         s.close()
    
    30 30
     
    
    31
    +    bottle.response.content_type = 'application/json; charset=UTF-8'
    
    31 32
         return json.dumps(ret)
    
    32 33
     
    
    33 34
     QueryRegister().register_path('/metadata_keys', binary_metadata_keys)
    
    ... ... @@ -67,6 +68,7 @@ def binary_by_metadata(key=None):
    67 68
                         'metadata_value': p.value})
    
    68 69
         s.close()
    
    69 70
     
    
    71
    +    bottle.response.content_type = 'application/json; charset=UTF-8'
    
    70 72
         return json.dumps(ret)
    
    71 73
     
    
    72 74
     QueryRegister().register_path('/binary/by_metadata', binary_by_metadata)

  • dakweb/queries/madison.py
    ... ... @@ -61,11 +61,12 @@ def madison():
    61 61
         result = list_packages(packages, **kwargs)
    
    62 62
     
    
    63 63
         if format is None:
    
    64
    -        bottle.response.content_type = 'text/plain'
    
    64
    +        bottle.response.content_type = 'text/plain; charset=UTF-8'
    
    65 65
             for row in result:
    
    66 66
                 yield row
    
    67 67
                 yield "\n"
    
    68 68
         else:
    
    69
    +        bottle.response.content_type = 'application/json; charset=UTF-8'
    
    69 70
             yield json.dumps(list(result))
    
    70 71
     
    
    71 72
     
    

  • dakweb/queries/source.py
    ... ... @@ -57,6 +57,7 @@ def dsc_in_suite(suite=None, source=None):
    57 57
     
    
    58 58
         s.close()
    
    59 59
     
    
    60
    +    bottle.response.content_type = 'application/json; charset=UTF-8'
    
    60 61
         return json.dumps(ret)
    
    61 62
     
    
    62 63
     QueryRegister().register_path('/dsc_in_suite', dsc_in_suite)
    
    ... ... @@ -100,6 +101,7 @@ def file_in_archive(filepattern=None):
    100 101
     
    
    101 102
         s.close()
    
    102 103
     
    
    104
    +    bottle.response.content_type = 'application/json; charset=UTF-8'
    
    103 105
         return json.dumps(ret)
    
    104 106
     
    
    105 107
     QueryRegister().register_path('/file_in_archive', file_in_archive)
    
    ... ... @@ -136,6 +138,7 @@ def sha256sum_in_archive(sha256sum=None):
    136 138
     
    
    137 139
         s.close()
    
    138 140
     
    
    141
    +    bottle.response.content_type = 'application/json; charset=UTF-8'
    
    139 142
         return json.dumps(ret)
    
    140 143
     
    
    141 144
     QueryRegister().register_path('/sha256sum_in_archive', sha256sum_in_archive)
    
    ... ... @@ -196,6 +199,7 @@ def all_sources():
    196 199
     
    
    197 200
         s.close()
    
    198 201
     
    
    202
    +    bottle.response.content_type = 'application/json; charset=UTF-8'
    
    199 203
         return json.dumps(ret)
    
    200 204
     
    
    201 205
     QueryRegister().register_path('/all_sources', all_sources)

  • dakweb/queries/suite.py
    ... ... @@ -48,6 +48,7 @@ def suites():
    48 48
     
    
    49 49
         s.close()
    
    50 50
     
    
    51
    +    bottle.response.content_type = 'application/json; charset=UTF-8'
    
    51 52
         return json.dumps(ret)
    
    52 53
     
    
    53 54
     QueryRegister().register_path('/suites', suites)
    
    ... ... @@ -115,6 +116,7 @@ def suite(suite=None):
    115 116
     
    
    116 117
         s.close()
    
    117 118
     
    
    119
    +    bottle.response.content_type = 'application/json; charset=UTF-8'
    
    118 120
         return json.dumps(so)
    
    119 121
     
    
    120 122
     QueryRegister().register_path('/suite', suite)


  • Reply to: