-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Add flask config: MAX_CONTENT_LENGTH
#36401
Conversation
MAX_CONTENT_LENGTH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about triggering a DAG with input configuration? Does it require more than 1MB? If we move this configuration to the web server section in airflow cfg, then we can set based on our requirements. For user profile information, is it feasible to restrict the size of form fields rather than relying on the defaults?
Thank you for your comment.
Sorry, what does this mean?
I'm not really sure what would be an appropriate value. Do you have any ideas?
Does this mean instead of hardcoding the value, we can set an item in airflow.cfg and get that value as a flask config?
Certainly, I feel it's feasible. Sorry, could you please clarify what you mean by "rather than relying on the defaults"? |
We can pass the JSON payload while triggering the DAG from the Airflow UI. JSON payload can be arbitrary length. It is much bigger. I haven't come across a use case where we pass more than 1MB. However, I am just checking.
Trying to see if can avoid hardcoding in the code.
I mean relying on the same default value for multiple forms in the Airflow UI. |
afc81e8
to
cd38156
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was checking to see if it accepts float or if we need to round the calculated value, but it looks like Flask implicitly does that.
LGTM, just a small nit, IMHO allowed_payload_size
is a better name.
Co-authored-by: Elad Kalif <45845474+eladkal@users.noreply.github.com>
a1e667e
to
eb324e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(cherry picked from commit 84063e7)
Add flask config to limit the allowed payload.
closes: #35196
I set it to limit to 1MB.
Before and after adding this config, I tried sending a string larger than 1MB from the Edit User page.
Before adding the config, it was possible to send; after adding, I confirmed that the attached error page was received.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.