From 56214264f19c8cfaa1db8a62d4541829c9c5ac22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Bryon?= Date: Mon, 14 Mar 2016 17:05:32 +0100 Subject: [PATCH] HTTPFile has 'content_type' property. Allows HTTPDownloadView to proxy Content-Type header. Refs #116 --- django_downloadview/files.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/django_downloadview/files.py b/django_downloadview/files.py index a83f31b..c6b4e0d 100644 --- a/django_downloadview/files.py +++ b/django_downloadview/files.py @@ -256,3 +256,8 @@ class HTTPFile(File): """ return self.request.headers['Content-Length'] + + @property + def content_type(self): + """Return content type of the file (from original response).""" + return self.request.headers['Content-Type']