You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2012/10/09 23:12:48 UTC

git commit: [#4571] be more cautious when deleting caching headers, they might not exist (e.g tests)

Updated Branches:
  refs/heads/master 9d15a0e4e -> 9adf82188


[#4571] be more cautious when deleting caching headers, they might not exist (e.g tests)


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/9adf8218
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/9adf8218
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/9adf8218

Branch: refs/heads/master
Commit: 9adf821889c55d9886f43b6f8b2550a3fb5bfeea
Parents: 9d15a0e
Author: Dave Brondsema <db...@geek.net>
Authored: Tue Oct 9 21:12:42 2012 +0000
Committer: Dave Brondsema <db...@geek.net>
Committed: Tue Oct 9 21:12:42 2012 +0000

----------------------------------------------------------------------
 Allura/allura/model/filesystem.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9adf8218/Allura/allura/model/filesystem.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/filesystem.py b/Allura/allura/model/filesystem.py
index 69f74e5..e620d7d 100644
--- a/Allura/allura/model/filesystem.py
+++ b/Allura/allura/model/filesystem.py
@@ -97,8 +97,10 @@ class File(MappedClass):
         pylons.response.content_type = self.content_type.encode('utf-8')
         pylons.response.cache_expires = asint(config.get('files_expires_header_secs', 60 * 60))
         pylons.response.last_modified = self._id.generation_time
-        del pylons.response.headers['Pragma']
-        del pylons.response.headers['Cache-Control']
+        if 'Pragma' in pylons.response.headers:
+            del pylons.response.headers['Pragma']
+        if 'Cache-Control' in pylons.response.headers:
+            del pylons.response.headers['Cache-Control']
         if not embed:
             pylons.response.headers.add(
                 'Content-Disposition',