From 48ce167d895b7e2a9d00884a4a8679851fa890af Mon Sep 17 00:00:00 2001 From: Loic Bistuer Date: Wed, 26 Jun 2013 14:36:25 +0700 Subject: [PATCH] Fixed missing initializations in WSGIRequest. Refs #20619 --- django/core/handlers/wsgi.py | 1 + django/http/request.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/django/core/handlers/wsgi.py b/django/core/handlers/wsgi.py index af78d1d269..38d8154ac9 100644 --- a/django/core/handlers/wsgi.py +++ b/django/core/handlers/wsgi.py @@ -103,6 +103,7 @@ class WSGIRequest(http.HttpRequest): content_length = 0 self._stream = LimitedStream(self.environ['wsgi.input'], content_length) self._read_started = False + self.resolver_match = None def _is_secure(self): return 'wsgi.url_scheme' in self.environ and self.environ['wsgi.url_scheme'] == 'https' diff --git a/django/http/request.py b/django/http/request.py index 37aa1a355a..b7f9d241a7 100644 --- a/django/http/request.py +++ b/django/http/request.py @@ -39,6 +39,10 @@ class HttpRequest(object): _upload_handlers = [] def __init__(self): + # WARNING: The `WSGIRequest` subclass doesn't call `super`. + # Any variable assignment made here should also happen in + # `WSGIRequest.__init__()`. + self.GET, self.POST, self.COOKIES, self.META, self.FILES = {}, {}, {}, {}, {} self.path = '' self.path_info = ''