Ticket #2280 (closed defect: fixed)
@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
Change History
comment:2 follow-up: ↓ 3 Changed 3 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 3 years ago by ondrejj
-
attachment
custom_content_type.patch
added
Path to TurboGears 2.0.rc1
comment:3 in reply to: ↑ 2 Changed 3 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?
I can confirm this is a bug.