From df7f1d314704e1562968f22d711d8b08e418b676 Mon Sep 17 00:00:00 2001 From: Conrad Weidenkeller Date: Tue, 23 Nov 2010 18:59:31 -0600 Subject: [PATCH] Added Custom mime.types file for swift. --- etc/mime.types-sample | 5 +++++ swift/proxy/server.py | 1 + 2 files changed, 6 insertions(+) create mode 100644 etc/mime.types-sample diff --git a/etc/mime.types-sample b/etc/mime.types-sample new file mode 100644 index 0000000000..d1d86bc513 --- /dev/null +++ b/etc/mime.types-sample @@ -0,0 +1,5 @@ +######################################################### +# A nice place to put custom Mime-Types for Swift # +# Please enter Mime-Types in standard mime.types format # +# Mime-Type Extension ex. image/jpeg jpg # +######################################################### diff --git a/swift/proxy/server.py b/swift/proxy/server.py index bacea4db9f..c5ee8745b7 100644 --- a/swift/proxy/server.py +++ b/swift/proxy/server.py @@ -1268,6 +1268,7 @@ class BaseApplication(object): self.account_ring = account_ring or \ Ring(os.path.join(swift_dir, 'account.ring.gz')) self.memcache = memcache + mimetypes.init(mimetypes.knownfiles + [os.path.join(self.swift_dir, 'mime.types')]) def get_controller(self, path): """