Alec Thomas wrote:
> Hi Jonas,
>
> Is it possible to partially revert the behaviour
introduced in r4946?
> Specifically, the "alternate format" links. I
can see how user
> provided content could be a security concern, but the
alternate format
> links are generated by plugins.
>
> I'd revert it myself, but didn't want to step on your
toes in case i
> was missing some nuance.
Ok, I think I see the problem. The
"Content-Disposition: attachment"
header sent my Mimeview.send_converted forces all
IContentConverter
content to be downloaded instead of rendered in the
browser.
While this is necessary for some formats (wiki2txt) it
probably breaks
plugins that expect their output to be rendered by the
browser.
I've attached a patch that moves the "attachment"
part of the
Content-Disposition header from send_converted into the
convert_content
medhod of the wiki2txt converted. This way only this
particular
converted is affected.
One downside with this approach is that this results in two
Content-Disposition headers. One from convert_content and
one from
send_converted. So we have to make sure all browsers do the
right thing
and parses both of them. But at least firefox seems to work
that way.
Cheers,
Jonas
>
> Alec
>
> On 4/15/07, Jonas Borgström <jonas edgewall.com> wrote:
>> Hi,
>>
>> The 0.10.4 Release candidate 1 is now available for
download here:
>>
>> http://ftp.edgewall.org/pub/trac/trac-0.10.4rc1.tar.gz
>> h
ttp://ftp.edgewall.org/pub/trac/trac-0.10.4rc1.zip
>> http://ftp.edgewall.org/pub/trac/trac-0.10.4rc1.win32.e
xe
>>
>> This release is mainly a bug fix release, more
information
>> about the changes can be found here:
>>
>> http://trac.e
dgewall.org/wiki/ChangeLog
>>
>> If no unexpected errors are found we hope to be
able to release
>> Trac 0.10.4 in a couple of days.
>>
>> / The Trac Team
>>
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Trac Development" group.
To post to this group, send email to trac-dev googlegroups.com
To unsubscribe from this group, send email to
trac-dev-unsubscribe googlegroups.com
For more options, visit this group at http://
groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---
Index: trac/mimeview/api.py
============================================================
=======
--- trac/mimeview/api.py (revision 5205)
+++ trac/mimeview/api.py (working copy)
 -605,7
+605,7 
content, selector)
req.send_response(200)
req.send_header('Content-Type', output_type)
- req.send_header('Content-Disposition', 'attachment;
filename=%s.%s' %
+ req.send_header('Content-Disposition',
'filename=%s.%s' %
(filename, ext))
req.end_headers()
req.write(content)
Index: trac/wiki/web_ui.py
============================================================
=======
--- trac/wiki/web_ui.py (revision 5205)
+++ trac/wiki/web_ui.py (working copy)
 -54,6
+54,7 
yield ('txt', 'Plain Text', 'txt',
'text/x-trac-wiki', 'text/plain', 9)
def convert_content(self, req, mimetype, content,
key):
+ req.send_header('Content-Disposition',
'attachment')
return (content, 'text/plain;charset=utf-8')
# INavigationContributor methods
|