comparison mercurial/hgweb.py @ 2103:caccf539c9a4

Use application/octet-stream as the content-type of unknown binary files
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Thu, 20 Apr 2006 15:42:02 +0200
parents 0bf2a9e5eff1
children 633d733e7b11
comparison
equal deleted inserted replaced
2102:c62112815801 2103:caccf539c9a4
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 or 'data') 422 mt = mt or 'application/octet-stream'
423 text = "(binary:%s)" % mt
423 mt = mt or 'text/plain' 424 mt = mt or 'text/plain'
424 425
425 def lines(): 426 def lines():
426 for l, t in enumerate(text.splitlines(1)): 427 for l, t in enumerate(text.splitlines(1)):
427 yield {"line": t, 428 yield {"line": t,