The send_error method always sends a Content-Type of 'text/html'. Other content types are both possible and desirable. For example, someone writing a REST server might wish to send XML error messages. Following the example of DEFAULT_ERROR_MESSAGE, I propose adding the following in the appropriate places: 91a92,94 > # Default error content-type > DEFAULT_ERROR_TYPE = 'text/html' > 345c348 < self.send_header("Content-Type", "text/html") --- > self.send_header("Content-Type", error_message_type) 351a355 > error_message_type = DEFAULT_ERROR_TYPE
Here's my attempted patch against trunk. The doc is poor (but what else should it contain?) and the attribute name could be better. I'm worried about lack of testing for this change as the module has virtually no tests. Should we start adding naive (regarding buildbots) tests?