Message139401
| Author |
Yoav.Weiss |
| Recipients |
Yoav.Weiss |
| Date |
2011年06月29日.09:35:24 |
| SpamBayes Score |
2.2031081e-07 |
| Marked as misclassified |
No |
| Message-id |
<1309340125.43.0.831188381846.issue12439@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I'm using BaseHTTPServer's send_response (from within a class that inherits BaseHTTPRequestHandler) with the following:
self.send_response(response.code, response.headers)
self.end_headers()
self.wfile.write(content)
self.wfile.flush()
When response is a httplib's HTTPResponse object, and its headers inherits from rfc822.Message.
What I see is that message is printed as is, including all the headers trailing "\r\n", after which the send_response method (BaseHTTPServer.py:381) adds another "\r\n".
Then send_response adds the "Server" and "Date" headers.
Since the headers before Server & Date include "\r\n\r\n", Date & server are considered by the browser as the content.
Am I misusing BaseHTTPServer? If not, this is a bug and "\r\n" should be removed from line 381, or added only after a check that shows they are not already there at the headers end, or in case there are no input headers. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年06月29日 09:35:25 | Yoav.Weiss | set | recipients:
+ Yoav.Weiss |
| 2011年06月29日 09:35:25 | Yoav.Weiss | set | messageid: <1309340125.43.0.831188381846.issue12439@psf.upfronthosting.co.za> |
| 2011年06月29日 09:35:24 | Yoav.Weiss | link | issue12439 messages |
| 2011年06月29日 09:35:24 | Yoav.Weiss | create |
|