Remove workaround for django bug #15152.
authorMagnus Hagander <magnus@hagander.net>
Thu, 19 May 2016 18:23:09 +0000 (14:23 -0400)
committerMagnus Hagander <magnus@hagander.net>
Thu, 19 May 2016 18:23:52 +0000 (14:23 -0400)
This bug is fixed before django 1.8, so remove our workaround which
should now be unnecessary.

pgweb/settings.py
pgweb/util/middleware.py

index 3b51c09babc4a451a6cb1f61fce053cfe65e84c5..d0f005791b7d6aeff3b64e9a2a6d23135157bb8f 100644 (file)
@@ -58,7 +58,6 @@ TEMPLATE_LOADERS = (
 )
 
 MIDDLEWARE_CLASSES = [
-       'pgweb.util.middleware.RequestCheckMiddleware',
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
        'django.contrib.messages.middleware.MessageMiddleware',
index 084f5821a0a27ca983b3d87e2cc286e0797d3fb7..41af91571c67cd3d1a1dceedfe0bb63a45a93b76 100644 (file)
@@ -50,16 +50,3 @@ class PgMiddleware(object):
        def process_request(self, request):
 # Thread local store for username, see comment at the top of this file
                _thread_locals.user = getattr(request, 'user', None)
-
-
-# Protection middleware against badly encoded query strings.
-# We could probably block this in the webserver further out, but this
-# is a quick-fix. From django ticket #15152.
-class RequestCheckMiddleware(object):
-       def process_request(self, request):
-               try:
-                       u'%s' % request.META.get('QUERY_STRING','')
-               except UnicodeDecodeError:
-                       response = HttpResponse()
-                       response.status_code = 400  #Bad Request
-                       return response