Opened 2 months ago
Last modified 2 weeks ago
#35281 assigned Cleanup/optimization
Use HTTP 413 status code for RequestDataTooBig
Reported by: | Milan Oberkirch | Owned by: | kokobhara |
---|---|---|---|
Component: | HTTP handling | Version: | 5.0 |
Severity: | Normal | Keywords: | |
Cc: | Milan Oberkirch | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
Other HTTP servers (e.g. Apache, Nginx) report a body which is to large with the status code 413 "Payload Too Large".
I propose to do the same in Django when handling a RequestDataTooBig exception in https://github.com/django/django/blob/f931cbec21cce3e2e68239c77614e6aa5026b882/django/core/handlers/exception.py#L63
This makes the behavior of a typical stack consisting of a reverse proxy and a Django project predictable for this type of error.
I can work on a patch if this change is acceptable to you.
Change History (6)
comment:1 by , 8 weeks ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Uncategorized → Cleanup/optimization |
comment:2 by , 8 weeks ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 2 weeks ago
Hello,
Is this issue still active?
I'm new to both Django and contributing to open-source, and would be more than excited to work on a patch that fixes this.
comment:4 by , 2 weeks ago
Feel free to take over! Also note this comment: https://github.com/django/django/pull/17960#pullrequestreview-1926197306
comment:5 by , 2 weeks ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:6 by , 2 weeks ago
Owner: | set to |
---|---|
Status: | new → assigned |
Following https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413 I think the request makes sense.
I haven't found a previous report about this and the code that added some handling for
RequestDataTooBig
may have missed to return a more specific code. Tangential follow up of #27820.