Use default send_file max-age consistently.

Prior to this commit, the send_file max-age hook and config were only
used for the static file handler. Now they are used when calling
helpers.send_file directly.
This commit is contained in:
Ron DuPlain 2012-04-24 01:48:05 -04:00
parent 7c79ce6e41
commit 26da6a5365
6 changed files with 88 additions and 45 deletions

View file

@ -1041,12 +1041,6 @@ class Flask(_PackageBoundObject):
self.error_handler_spec.setdefault(key, {}).setdefault(None, []) \
.append((code_or_exception, f))
def get_send_file_options(self, filename):
# Override: Hooks in SEND_FILE_MAX_AGE_DEFAULT config.
options = super(Flask, self).get_send_file_options(filename)
options['cache_timeout'] = self.config['SEND_FILE_MAX_AGE_DEFAULT']
return options
@setupmethod
def template_filter(self, name=None):
"""A decorator that is used to register custom template filter.