Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

In 0.7, make_default_options_response is a public API

  • Loading branch information...
commit 952967fcab0ffccc6b67485e8eed994a69d38d03 1 parent 43ae651
@mitsuhiko authored
Showing with 12 additions and 2 deletions.
  1. +4 −0 CHANGES
  2. +8 −2 flask/app.py
View
4 CHANGES
@@ -8,6 +8,10 @@ Version 0.7
Release date to be announced, codename to be selected
+- Added :meth:`~flask.Flask.make_default_options_response`
+ which can be used by subclasses to alter the default
+ behaviour for `OPTIONS` responses.
+
Version 0.6.1
-------------
View
10 flask/app.py
@@ -690,13 +690,19 @@ def dispatch_request(self):
# if we provide automatic options for this URL and the
# request came with the OPTIONS method, reply automatically
if rule.provide_automatic_options and req.method == 'OPTIONS':
- return self._make_default_options_response()
+ return self.make_default_options_response()
# otherwise dispatch to the handler for that endpoint
return self.view_functions[rule.endpoint](**req.view_args)
except HTTPException, e:
return self.handle_http_exception(e)
- def _make_default_options_response(self):
+ def make_default_options_response(self):
+ """This method is called to create the default `OPTIONS` response.
+ This can be changed through subclassing to change the default
+ behaviour of `OPTIONS` responses.
+
+ .. versionadded:: 0.7
+ """
# This would be nicer in Werkzeug 0.7, which however currently
# is not released. Werkzeug 0.7 provides a method called
# allowed_methods() that returns all methods that are valid for
Please sign in to comment.
Something went wrong with that request. Please try again.