mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 00:43:53 +00:00
[api] clean code for http errors
This commit is contained in:
@@ -417,5 +417,13 @@ for line in mime_str.splitlines():
|
||||
if len(pair) == 2:
|
||||
MIME_MAP[pair[0]] = pair[1]
|
||||
|
||||
|
||||
def get_file_mime(name):
|
||||
sufix = os.path.splitext(name)[1][1:]
|
||||
if sufix:
|
||||
return MIME_MAP[sufix]
|
||||
return None
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print MIME_MAP
|
||||
|
Reference in New Issue
Block a user