From 5c9b52c4731eebd2400c0ef6c94944eb1f29cec8 Mon Sep 17 00:00:00 2001 From: Matyas Selmeci Date: Jan 12 2017 16:43:28 +0000 Subject: Fix kojiweb error using getfile to download non-text files URLs like http://koji-hub-testing.chtc.wisc.edu/koji/getfile?taskID=228280&name=osg-build-1.7.1-1.osg33.el6.noarch.rpm fail with a 500 Internal Server Error when `name` refers to an RPM or other binary file. (Those URLs do still work for log files). The error given is "TypeError: append() takes exactly one argument (2 given)" --- diff --git a/www/kojiweb/index.py b/www/kojiweb/index.py index d9cd5a1..7bcd82a 100644 --- a/www/kojiweb/index.py +++ b/www/kojiweb/index.py @@ -742,7 +742,7 @@ def getfile(environ, taskID, name, offset=None, size=None): else: ctype = 'application/octet-stream' if ctype != 'text/plain': - environ['koji.headers'].append('Content-Disposition', 'attachment; filename=%s' % name) + environ['koji.headers'].append(['Content-Disposition', 'attachment; filename=%s' % name]) environ['koji.headers'].append(['Content-Type', ctype]) file_size = int(file_info['st_size'])