mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Bug #1117556: SimpleHTTPServer now tries to find and use the system's
mime.types file for determining MIME types.
This commit is contained in:
parent
0540be96f3
commit
83cc0d0add
2 changed files with 6 additions and 1 deletions
|
@ -191,7 +191,9 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
|||
return self.extensions_map[ext]
|
||||
else:
|
||||
return self.extensions_map['']
|
||||
|
||||
|
||||
if not mimetypes.inited:
|
||||
mimetypes.init() # try to read system mime.types
|
||||
extensions_map = mimetypes.types_map.copy()
|
||||
extensions_map.update({
|
||||
'': 'application/octet-stream', # Default
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue