#35673: When URL has 1000+ query parameters, and DEBUG=True, Django does not
generate the error page correctly
-------------------------------+-------------------------------------------
     Reporter:  Pēteris Caune  |                     Type:  Bug
       Status:  new            |                Component:  Error reporting
      Version:  5.1            |                 Severity:  Normal
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+-------------------------------------------
 When the number of query parameters in URL exceeds
 settings.DATA_UPLOAD_MAX_NUMBER_FIELDS, Django takes more than a second to
 generate the error page and eventually returns HTTP 500 with a blank page.
 The "manage.py runserver" output shows a long chain of exceptions,
 delimited with "The above exception was the direct cause of the following
 exception:" line.

 To reproduce: start a new Django project, and place the following in
 urls.py:

 {{{
 from django.http import HttpResponse
 from django.urls import path


 def index(request):
     request.GET.getlist("a")
     url = "/?" + "&".join([f"a={i}" for i in range(0, 1001)])
     return HttpResponse(f"""<a href="{url}">Click me</a>""",
 content_type="text/html")


 urlpatterns = [
     path("", index),
 ]
 }}}

 The problem is only triggered if

 * DEBUG=True (otherwise, Django generates a HTTP 400 response with no
 delay)
 * If the view accesses request.GET
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35673>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701914ab555f6-8fa9489c-3f57-4e05-afd6-3851f3b60854-000000%40eu-central-1.amazonses.com.

Reply via email to