Commit 8e37d000 authored by 's avatar

Merged guess_content_type default fix from branch

parent 1b36a91f
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
# #
############################################################################## ##############################################################################
"""A utility module for content-type handling.""" """A utility module for content-type handling."""
__version__='$Revision: 1.11 $'[11:-2] __version__='$Revision: 1.12 $'[11:-2]
src=""" src="""
htm, html: text/html htm, html: text/html
...@@ -169,7 +169,7 @@ def guess_content_type(name='', body='', default=None): ...@@ -169,7 +169,7 @@ def guess_content_type(name='', body='', default=None):
if type is None: if type is None:
if body: if body:
if find_binary(body) >= 0: if find_binary(body) >= 0:
type='application/octet-stream' type=default or 'application/octet-stream'
else: else:
type=(default or text_type(body) type=(default or text_type(body)
or 'text/x-unknown-content-type') or 'text/x-unknown-content-type')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment