equal
deleted
inserted
replaced
48 raise inst |
48 raise inst |
49 |
49 |
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] |
58 |
58 |
59 def _filerevision(web, tmpl, fctx): |
59 def _filerevision(web, tmpl, fctx): |