Skip to content

Commit

Permalink
Add flask config: MAX_CONTENT_LENGTH (apache#36401)
Browse files Browse the repository at this point in the history
  • Loading branch information
teihenn authored Dec 30, 2023
1 parent 465c2f6 commit 84063e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions airflow/config_templates/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1855,6 +1855,13 @@ webserver:
type: boolean
example: "False"
default: "False"
allowed_payload_size:
description: |
The maximum size of the request payload (in MB) that can be sent.
version_added: 2.8.1
type: float
example: ~
default: "1.0"
email:
description: |
Configuration email backend and whether to
Expand Down
2 changes: 2 additions & 0 deletions airflow/www/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def create_app(config=None, testing=False):

flask_app.config["PERMANENT_SESSION_LIFETIME"] = timedelta(minutes=settings.get_session_lifetime_config())

flask_app.config["MAX_CONTENT_LENGTH"] = conf.getfloat("webserver", "allowed_payload_size") * 1024 * 1024

webserver_config = conf.get_mandatory_value("webserver", "config_file")
# Enable customizations in webserver_config.py to be applied via Flask.current_app.
with flask_app.app_context():
Expand Down

0 comments on commit 84063e7

Please sign in to comment.