From c14ad4e2a45211bbbedcf8c67f71adf94572f34a Mon Sep 17 00:00:00 2001 From: schlatterbeck Date: Mon, 30 Nov 2009 21:55:59 +0000 Subject: [PATCH] Fix traceback on .../msgN/ url, this requests the file content and for apache mod_wsgi produced a traceback because the mime type is None for messages, fixes issue2550586, thanks to ThomasAH for reporting and to Intevation for funding the fix. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4395 57a73879-2fb5-44c3-a270-3262357dd7e2 --- CHANGES.txt | 4 ++++ roundup/cgi/client.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index ba91730..6c85c17 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -21,6 +21,10 @@ Fixes: sent via email. We now check that user has permission on the message content and files properties. Thanks to Intevation for funding this fix. +- Fix traceback on .../msgN/ url, this requests the file content and for + apache mod_wsgi produced a traceback because the mime type is None for + messages, fixes issue2550586, thanks to ThomasAH for reporting and to + Intevation for funding the fix. 2009-10-09 1.4.10 (r4374) diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py index 9698074..b760e0c 100644 --- a/roundup/cgi/client.py +++ b/roundup/cgi/client.py @@ -880,6 +880,9 @@ class Client: "this file.") mime_type = klass.get(nodeid, 'type') + # Can happen for msg class: + if not mime_type: + mime_type = 'text/plain' # if the mime_type is HTML-ish then make sure we're allowed to serve up # HTML-ish content -- 2.30.2