comparison mercurial/hgweb.py @ 2095:0bf2a9e5eff1

Don't send "Content-Type: none" mimetypes.guess_type will return (None, None) when it can't detect the filetype.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Wed, 19 Apr 2006 11:41:22 -0700
parents 778281d46bb2
children caccf539c9a4
comparison
equal deleted inserted replaced
2094:c067ee483d2e 2095:0bf2a9e5eff1
417 mfn = cs[0] 417 mfn = cs[0]
418 418
419 mt = mimetypes.guess_type(f)[0] 419 mt = mimetypes.guess_type(f)[0]
420 rawtext = text 420 rawtext = text
421 if util.binary(text): 421 if util.binary(text):
422 text = "(binary:%s)" % mt 422 text = "(binary:%s)" % (mt or 'data')
423 mt = mt or 'text/plain'
423 424
424 def lines(): 425 def lines():
425 for l, t in enumerate(text.splitlines(1)): 426 for l, t in enumerate(text.splitlines(1)):
426 yield {"line": t, 427 yield {"line": t,
427 "linenumber": "% 6d" % (l + 1), 428 "linenumber": "% 6d" % (l + 1),