Ticket #2280 (closed defect: fixed)

Opened 1 year ago

Last modified 6 months ago

@expose(content_type="text/plain") does not work

Reported by: ondrejj Assigned to:
Priority: highest Milestone: 2.1a1
Component: TurboGears Version: 2.0b7
Severity: normal Keywords:
Cc: lmacken

Description

After making new quickstart template and adding this:

    @expose(content_type="text/plain")
    def test(self):
        return 'a<br/>bx'

my content type of this test object is still "text/html" and in browser there is "a<newline>bx" instead of "a<br/>bx". It's possible to use:

pylons.response.headers['Content-Type'] = 'text/plain'

but I think this is too complicated.

Attachments

custom_content_type.patch (1.0 kB) - added by ondrejj on 04/28/09 03:48:50.
Path to TurboGears 2.0.rc1

Change History

04/23/09 08:13:17 changed by jorge.vargas

  • priority changed from normal to highest.

I can confirm this is a bug.

(follow-up: ↓ 3 ) 04/24/09 17:39:57 changed by percious

This is fixed in 2.1 trunk. Anyone who wants to backport it to 2.0 is welcome. See: http://bitbucket.org/mramm/tg-21/changeset/608eb2df6c0a/

04/28/09 03:48:50 changed by ondrejj

  • attachment custom_content_type.patch added.

Path to TurboGears 2.0.rc1

(in reply to: ↑ 2 ) 04/28/09 03:50:05 changed by ondrejj

Replying to percious:

This is fixed in 2.1 trunk. Anyone who wants to backport it to 2.0 is welcome. See: http://bitbucket.org/mramm/tg-21/changeset/608eb2df6c0a/

Patch attached. Works for me.

Anybody can review it and apply to 2.0 branch?

06/27/09 17:29:25 changed by lmacken

  • cc set to lmacken.
  • status changed from new to closed.
  • resolution set to fixed.

This patch is in TG 2.0.1

09/28/09 03:47:57 changed by jorge.vargas

Please se #2378