diff --git a/airflow/config_templates/config.yml b/airflow/config_templates/config.yml index 0930fada76714..059467e4a0c03 100644 --- a/airflow/config_templates/config.yml +++ b/airflow/config_templates/config.yml @@ -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 diff --git a/airflow/www/app.py b/airflow/www/app.py index b8be40a4210da..749efe8912c03 100644 --- a/airflow/www/app.py +++ b/airflow/www/app.py @@ -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():