Commit 1c6cb1ce authored by Peter Palfrader's avatar Peter Palfrader

and ensure version numbers are ASCII too

parent e4e5c89a
......@@ -145,6 +145,7 @@ class PackageController(BaseController):
def source_version(self, source, version):
self._ensure_ascii(source)
self._ensure_ascii(version)
try:
#etag_cache( app_globals.shm.packages_get_etag(self._db()) )
set_expires(int(config['app_conf']['expires.package.source_version']))
......@@ -277,6 +278,7 @@ class PackageController(BaseController):
@jsonify
def mr_source_version_srcfiles(self, source, version):
self._ensure_ascii(source)
self._ensure_ascii(version)
try:
set_expires(int(config['app_conf']['expires.package.mr.source_version']))
sourcefiles = app_globals.shm.packages_get_source_files(self._db(), source, version)
......@@ -294,6 +296,7 @@ class PackageController(BaseController):
@jsonify
def mr_source_version_binpackages(self, source, version):
self._ensure_ascii(source)
self._ensure_ascii(version)
try:
set_expires(int(config['app_conf']['expires.package.mr.source_version']))
binpkgs = app_globals.shm.packages_get_binpkgs_from_source(self._db(), source, version)
......@@ -310,7 +313,9 @@ class PackageController(BaseController):
@jsonify
def mr_source_version_binfiles(self, source, version, binary, binary_version):
self._ensure_ascii(source)
self._ensure_ascii(version)
self._ensure_ascii(binary)
self._ensure_ascii(binary_version)
try:
set_expires(int(config['app_conf']['expires.package.mr.source_version']))
binfiles = app_globals.shm.packages_get_binary_files_from_packagenames(self._db(), source, version, binary, binary_version)
......@@ -331,6 +336,7 @@ class PackageController(BaseController):
@jsonify
def mr_source_version_allfiles(self, source, version):
self._ensure_ascii(source)
self._ensure_ascii(version)
try:
set_expires(int(config['app_conf']['expires.package.mr.source_version']))
sourcefiles = app_globals.shm.packages_get_source_files(self._db(), source, version)
......@@ -375,6 +381,7 @@ class PackageController(BaseController):
@jsonify
def mr_binary_version_binfiles(self, binary, binary_version):
self._ensure_ascii(binary)
self._ensure_ascii(binary_version)
try:
binfiles = app_globals.shm.packages_get_binary_files(self._db(), binary, binary_version)
if len(binfiles) == 0: abort(404, 'No such package or no binary files found')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment