forked from orbit-oss/flask
Merge branch 'master' into blueprints
This commit is contained in:
commit
2d946b96a1
7 changed files with 19 additions and 297 deletions
|
|
@ -200,6 +200,12 @@ class Flask(_PackageBoundObject):
|
|||
'MAX_CONTENT_LENGTH': None
|
||||
})
|
||||
|
||||
#: The rule object to use for URL rules created. This is used by
|
||||
#: :meth:`add_url_rule`. Defaults to :class:`werkzeug.routing.Rule`.
|
||||
#:
|
||||
#: .. versionadded:: 0.7
|
||||
url_rule_class = Rule
|
||||
|
||||
#: the test client that is used with when `test_client` is used.
|
||||
#:
|
||||
#: .. versionadded:: 0.7
|
||||
|
|
@ -693,7 +699,7 @@ class Flask(_PackageBoundObject):
|
|||
if 'OPTIONS' not in methods:
|
||||
methods = tuple(methods) + ('OPTIONS',)
|
||||
provide_automatic_options = True
|
||||
rule = Rule(rule, methods=methods, **options)
|
||||
rule = self.url_rule_class(rule, methods=methods, **options)
|
||||
rule.provide_automatic_options = provide_automatic_options
|
||||
self.url_map.add(rule)
|
||||
if view_func is not None:
|
||||
|
|
|
|||
|
|
@ -380,7 +380,10 @@ def send_file(filename_or_fp, mimetype=None, as_attachment=False,
|
|||
rv.set_etag('flask-%s-%s-%s' % (
|
||||
os.path.getmtime(filename),
|
||||
os.path.getsize(filename),
|
||||
adler32(filename) & 0xffffffff
|
||||
adler32(
|
||||
filename.encode('utf8') if isinstance(filename, unicode)
|
||||
else filename
|
||||
) & 0xffffffff
|
||||
))
|
||||
if conditional:
|
||||
rv = rv.make_conditional(request)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue