-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
Continue #1489: Add kwarg to disable auto OPTIONS on add_url_rule #2249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adds support for a kwarg `provide_automatic_options` on `add_url_rule`, which lets you turn off the automatic OPTIONS response on a per-URL basis even if your view functions are functions, not classes (so you can't provide attrs on them).
In add_url_rule, break provide_automatic_options out to an explicit kwarg, and add notes to the docstring.
move test next to existing test, rename reword / reflow param doc
Contributor
|
I'm really curious why the original option was implemented as attribute on the
view function. Perhaps there is a reason it is not part of `add_url_rule`'s
signature.
…On Fri, Apr 21, 2017 at 07:19:06AM -0700, David Lord wrote:
Merge master into #1489 and do some cleanup.
You can view, comment on, or merge this pull request online at:
#2249
-- Commit Summary --
* Add kwarg to disable auto OPTIONS on add_url_rule
* Updated changelog
* Merge branch 'master' of github.com:mitsuhiko/flask
* provide_automatic_options as explicit arg
* Update change log
* Merge branch 'master' into jrmccarthy-master
* update changelog for #1489
-- File Changes --
M CHANGES (4)
M flask/app.py (11)
M tests/test_basic.py (50)
-- Patch Links --
https://github.com/pallets/flask/pull/2249.patch
https://github.com/pallets/flask/pull/2249.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#2249
|
Member
Author
|
Yeah, I found that a little weird too, but this doesn't seem to hurt anything. |
Contributor
|
cc @mitsuhiko?
…On Fri, Apr 21, 2017 at 08:02:15AM -0700, David Lord wrote:
Yeah, I found that a little weird too, but this doesn't seem to hurt anything.
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#2249 (comment)
|
Member
Author
|
The original issue #1488 explains a little more: they're registering more routes by endpoint name, without providing the view function each time. So they can't set the attribute because there's nothing to set it on. |
Contributor
|
That's fair, though I wonder if we should deprecate the other way to do it.
…On Fri, Apr 21, 2017 at 08:13:15AM -0700, David Lord wrote:
The original issue #1488 explains a little more: they're registering more routes by endpoint name, without providing the view function each time. So they can't set the attribute because there's nothing to set it on.
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#2249 (comment)
|
Member
Author
|
I'll open an issue separate from this. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Merge master into #1489 and do some cleanup.