mercurial/hgweb/webcommands.py
changeset 6981 029a54423a96
parent 6857 e8c2dae47799
child 7029 b84d27386285
equal deleted inserted replaced
6980:2268edff1bec 6981:029a54423a96
    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):