appengine
appengine copied to clipboard
httpserver: ResponseWriter not using DetectContentType
Attached is a simple app that serves / (html), /text (text), and /png (a png). It works fine in the dev app server and as a standalone Go program, but uploaded to App Engine the ResponseWriter implementation seems not to call http.DetectContentType to fill in the Content-Type header. Instead App Engine seems to send back text/html; charset=utf-8 all the time. This is unfortunate for /text and useless for /png.
Can we get this fixed? Strictly speaking it is not a requirement that all ResponseWriter implementations use DetectContentType, but we've arranged a bit of a soft standard that all of them do.
Thanks.
(On the flip side, I love the fact that writing files to cloud storage uses DetectContentType to set the Content-Type; that makes the Go libraries better than gsutil cp!)
FYI, I don't see an attachment.
Thanks @dsymonds, now attached to top message. I went through the motions the first time but missed the quite well-hidden "We don't support that file type" error message from the GitHub UI. Renamed to x.go.txt.