##// END OF EJS Templates
hgweb: Serve raw non-binary files as text/plain...
Rocco Rutte -
r6981:029a5442 default
parent child Browse files
Show More
@@ -50,8 +50,8 b' def rawfile(web, req, tmpl):'
50 path = fctx.path()
50 path = fctx.path()
51 text = fctx.data()
51 text = fctx.data()
52 mt = mimetypes.guess_type(path)[0]
52 mt = mimetypes.guess_type(path)[0]
53 if mt is None or binary(text):
53 if mt is None:
54 mt = mt or 'application/octet-stream'
54 mt = binary(text) and 'application/octet-stream' or 'text/plain'
55
55
56 req.respond(HTTP_OK, mt, path, len(text))
56 req.respond(HTTP_OK, mt, path, len(text))
57 return [text]
57 return [text]
General Comments 0
You need to be logged in to leave comments. Login now