Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2280 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

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

Reported by: ondrejj Owned by:
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 Download (1019 bytes) - added by ondrejj 10 years ago.
Path to TurboGears 2.0.rc1

Change History

comment:1 Changed 10 years ago by jorge.vargas

  • Priority changed from normal to highest

I can confirm this is a bug.

comment:2 follow-up: ↓ 3 Changed 10 years ago 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/

Changed 10 years ago by ondrejj

Path to TurboGears 2.0.rc1

comment:3 in reply to: ↑ 2 Changed 10 years ago 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?

comment:4 Changed 10 years ago by lmacken

  • Cc lmacken added
  • Status changed from new to closed
  • Resolution set to fixed

This patch is in TG 2.0.1

comment:5 Changed 10 years ago by jorge.vargas

Please se #2378

Note: See TracTickets for help on using tickets.