comparison mercurial/hgweb/webcommands.py @ 5926:15ef6b9c1f2f

hgweb: be sure to send a valid content-type for raw files
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Tue, 22 Jan 2008 12:31:55 +0100
parents c6274913eba5
children 06467b51ab9c
comparison
equal deleted inserted replaced
5925:c6274913eba5 5926:15ef6b9c1f2f
28 return 28 return
29 29
30 path = fctx.path() 30 path = fctx.path()
31 text = fctx.data() 31 text = fctx.data()
32 mt = mimetypes.guess_type(path)[0] 32 mt = mimetypes.guess_type(path)[0]
33 if util.binary(text): 33 if mt is None or util.binary(text):
34 mt = mt or 'application/octet-stream' 34 mt = mt or 'application/octet-stream'
35 35
36 req.httphdr(mt, path, len(text)) 36 req.httphdr(mt, path, len(text))
37 req.write(text) 37 req.write(text)
38 38