File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 11import structlog
22from django .conf import settings
3+ from django .core .exceptions import TooManyFieldsSent
34from django .http import HttpResponse
45
56
@@ -21,7 +22,19 @@ def __init__(self, get_response):
2122 self .get_response = get_response
2223
2324 def __call__ (self , request ):
24- for key , value in request .GET .items ():
25+ try :
26+ query_params = request .GET .items ()
27+ except TooManyFieldsSent :
28+ log .info (
29+ "Too many GET parameters in request." ,
30+ url = request .build_absolute_uri (),
31+ )
32+ return HttpResponse (
33+ "The number of GET parameters exceeded the maximum allowed." ,
34+ status = 400 ,
35+ )
36+
37+ for key , value in query_params :
2538 if "\x00 " in value :
2639 log .info (
2740 "NULL (0x00) characters in GET attributes." ,
You can’t perform that action at this time.
0 commit comments