Mercurial > p > roundup > code
comparison roundup/cgi/client.py @ 4291:b1772fdb09d0
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.
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Mon, 30 Nov 2009 21:55:59 +0000 |
| parents | e24a6ca34448 |
| children | d51a9c498dc4 |
comparison
equal
deleted
inserted
replaced
| 4290:236939e4137b | 4291:b1772fdb09d0 |
|---|---|
| 878 classname, 'content', nodeid): | 878 classname, 'content', nodeid): |
| 879 raise Unauthorised, self._("You are not allowed to view " | 879 raise Unauthorised, self._("You are not allowed to view " |
| 880 "this file.") | 880 "this file.") |
| 881 | 881 |
| 882 mime_type = klass.get(nodeid, 'type') | 882 mime_type = klass.get(nodeid, 'type') |
| 883 # Can happen for msg class: | |
| 884 if not mime_type: | |
| 885 mime_type = 'text/plain' | |
| 883 | 886 |
| 884 # if the mime_type is HTML-ish then make sure we're allowed to serve up | 887 # if the mime_type is HTML-ish then make sure we're allowed to serve up |
| 885 # HTML-ish content | 888 # HTML-ish content |
| 886 if mime_type in ('text/html', 'text/x-html'): | 889 if mime_type in ('text/html', 'text/x-html'): |
| 887 if not self.instance.config['WEB_ALLOW_HTML_FILE']: | 890 if not self.instance.config['WEB_ALLOW_HTML_FILE']: |
