Skip to content

automatic options as separate route#5918

Open
davidism wants to merge 1 commit intomainfrom
automatic-options
Open

automatic options as separate route#5918
davidism wants to merge 1 commit intomainfrom
automatic-options

Conversation

@davidism
Copy link
Copy Markdown
Member

@davidism davidism commented Feb 12, 2026

Implement provide_automatic_options as a regular part of the routing and view dispatch, rather than as a special check on every request.

Can be updated to do except DuplicateRuleError instead of Exception once Werkzeug 3.2 is out. Relies on the duplicate check to not add the internal route multiple times, for example if @app.get and @app.post register different view functions for the same URL. But nothing breaks if the rule is added multiple times, it's just messy.

Adjusts flask routes to no show the _automatic_options endpoint, as that would be really noisy.

Also moves the static view out instead of using a lambda and weakref, to match how this new view is handled.

expands on #5917, fixes #5916

@davidism davidism added this to the 3.2.0 milestone Feb 12, 2026
@davidism davidism closed this Feb 13, 2026
@davidism davidism reopened this Feb 13, 2026
@pallets pallets deleted a comment from indoor47 Feb 26, 2026
@pallets pallets deleted a comment from Dlove123 Mar 22, 2026
@pallets pallets deleted a comment from afurm Apr 12, 2026
@pallets pallets deleted a comment from Qodo-Free-For-OSS Apr 30, 2026
@davidism davidism force-pushed the automatic-options branch from 5565391 to 80669a0 Compare May 2, 2026 04:06
yaoyi0427 added a commit to yaoyi0427/flask that referenced this pull request May 5, 2026
Document the provide_automatic_options parameter and other
arguments. This helps users understand how URL routing works
in Flask.

Refs: pallets#5918

Co-authored-by: 姚毅 <yaoyi@yaoyideMac-mini.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

provide_automatic_options is weird

1 participant