1
0
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:
poetwang
2012-09-01 13:35:21 +08:00
parent d7a570dc91
commit a09bae86e6
4 changed files with 113 additions and 79 deletions

View File

@@ -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