On windows, SimpleHTTPServer shows a severe bug: it
sends a wrong content-length header. In fact, it sends
the wrong data. It differentiates between the mime types
"text/" and the remaining ones and decides upon that if it
should open the file in binary mode.
That is illegal according to the RFCs, any text/ mimetype
has to be served using \r\n line endings, therefore it may
not read it in non-binary mode.
My suggestion: remove the disambiguation (that means
the if block).
Umm, yeah, my initial reason to report this: if the
content-length value is greater than the actual delivered
data size, gateways/clients may lock up if they use
pipelining. (And they do, BTDT). The reason for that
wrong value: the filesize if determined before line end
conversion (implicit because of non-binary read file mode)
.
|