durusmail: quixote-users: Re: behavior of set_content_type()
Patch[1] for http_response.py for quixote-2.1
2005-08-21
2005-08-21
2005-08-29
2005-08-29
Re: Patch[1] for http_response.py for quixote-2.1
2005-08-29
2005-08-29
2005-09-01
behavior of set_content_type()
Re: behavior of set_content_type()
2005-08-30
2005-08-30
2005-08-30
Re: behavior of set_content_type()
Hamish Lawson
2005-08-30
Neil Schemenauer wrote:

>         if charset is not None or not content_type.startswith('text/'):
>             self.charset = charset

This code is deciding two things: whether the user asked for charset
to be changed, and whether they are allowed this change. I think it
would be better if it just did the first. *If* Quixote is to adopt a
policy of outputting a charset parameter only for text/* types, I
think it would be better for this policy to be enforced in
generate_headers instead, set_content_type not being the only way to
change charset. But should Quixote adopt such a policy? It may have
sounded like I was arguing for this, but rather I was just observing
that for some content types the value of the charset parameter didn't
matter as it would be ignored by the client anyway. But rather than
Quixote trying to decide when to omit the charset parameter, I think
the safer option would be to always include it in the response and
leave it to the client to decide whether to use it. After all it's not
a clean split between text/* types and the rest - charset is relevant
to the various XML types, including image/svg.


Hamish
reply