Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

Provide a configuration option to control automatic option responses#5496

Merged
pgjones merged 1 commit intopallets:mainfrom
pgjones:options
Jun 7, 2024
Merged

Provide a configuration option to control automatic option responses#5496
pgjones merged 1 commit intopallets:mainfrom
pgjones:options

Conversation

@pgjones
Copy link
Member

By default Flask will provide responses to OPTIONS requests that are automatically generated. These responses list the valid methods in the response headers. Whilst this is useful, it can be frowned on by auditors hence an ability to disable it wholesale is useful.

By default Flask will provide responses to OPTIONS requests that areautomatically generated. These responses list the valid methods in theresponse headers. Whilst this is useful, it can be frowned on byauditors hence an ability to disable it wholesale is useful.
@davidism
Copy link
Member

Does this make sense as a config option? Lately I've been tending to use init params instead of config unless it actually makes sense to change something per deployment. (And you could still change it per deployment, you'd just have to do it manually in the app factory.) It seems like you'd either want automatic options or not.

How would this interact withResponse CORS attributes/headers, the Flask-CORS extension, or OpenAPI extensions?

@pgjones
Copy link
MemberAuthor

Does this make sense as a config option?

I would probably have different values in development and production given the information is useful in development. I do this via environment variables and the config.from_prefixed_env, so a config variable would be the easiest. I'd also argue it is more consistent with the other Flask options.

How would this interact with Response CORS attributes/headers, the Flask-CORS extension, or OpenAPI extensions?

I think these would manage the OPTIONS responses directly anyway and this could make it easier to turn off the Flask default, e.g.Flask-CORS.

davidism reacted with thumbs up emoji

@davidismdavidism added this to the3.1.0 milestoneJun 7, 2024
@pgjonespgjones merged commitd718ecf intopallets:mainJun 7, 2024
@pgjonespgjones deleted the options branchJune 7, 2024 19:04
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsJun 22, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@davidismdavidismdavidism approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

3.1.0

Development

Successfully merging this pull request may close these issues.

2 participants

@pgjones@davidism

[8]ページ先頭

©2009-2026 Movatter.jp