def get_mime_type(self, path: str):
"""
Returns the mime type base on the extension of the file that the
client is requesting.
path: The relative path to the static file. By default it will
search in the static folder in the application root.
"""
match = self._static_regex.search(path)
if match is not None and match.group('ext') is not None:
return mimetypes.types_map[match.group('ext')]
评论列表
文章目录