[New-bugs-announce] [issue1492] BaseHTTPServer hard-codes Content-Type for error messages

samwyse report at bugs.python.org
Fri Nov 23 14:04:07 CET 2007


New submission from samwyse:

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

----------
messages: 57784
nosy: samwyse
severity: normal
status: open
title: BaseHTTPServer hard-codes Content-Type for error messages

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1492>
__________________________________


More information about the New-bugs-announce mailing list