[csw-devel] SF.net SVN: gar:[20024] csw/mgar/gar/v2/lib/web/pkgdb_web.py
wahwah at users.sourceforge.net
wahwah at users.sourceforge.net
Fri Jan 4 18:32:32 CET 2013
Revision: 20024
http://gar.svn.sourceforge.net/gar/?rev=20024&view=rev
Author: wahwah
Date: 2013-01-04 17:32:32 +0000 (Fri, 04 Jan 2013)
Log Message:
-----------
pkgdb-web: Return HTTP bad request
When the 'basename' parameter is required but missing, return 'bad request'
instead of throwing an exception and failing with a 500.
Modified Paths:
--------------
csw/mgar/gar/v2/lib/web/pkgdb_web.py
Modified: csw/mgar/gar/v2/lib/web/pkgdb_web.py
===================================================================
--- csw/mgar/gar/v2/lib/web/pkgdb_web.py 2013-01-04 17:00:14 UTC (rev 20023)
+++ csw/mgar/gar/v2/lib/web/pkgdb_web.py 2013-01-04 17:32:32 UTC (rev 20024)
@@ -310,7 +310,10 @@
class PkgnamesAndPathsByBasename(object):
def GET(self, catrel, arch, osrel):
user_data = web.input()
- basename = user_data.basename
+ try:
+ basename = user_data.basename
+ except AttributeError, e:
+ raise web.badrequest()
send_filename = (
'%s-%s-%s-%s-packages.txt'
% (catrel, arch, osrel, basename.replace('/', '-')))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list