diff --git a/django/core/handlers/modpython.py b/django/core/handlers/modpython.py
index eba9dd3..6be33a0 100644
a
|
b
|
class ModPythonRequest(http.HttpRequest):
|
32 | 32 | # circumstances (it's out of mod_python's control a bit), so we use |
33 | 33 | # req.uri and some string manipulations to get the right value. |
34 | 34 | if root and req.uri.startswith(root): |
35 | | self.path_info = force_unicode(req.uri[len(root):]) |
| 35 | self.path_info = force_unicode(req.uri[len(root):], errors='ignore') |
36 | 36 | else: |
37 | 37 | self.path_info = self.path |
38 | 38 | if not self.path_info: |
… |
… |
class ModPythonHandler(BaseHandler):
|
149 | 149 | set_script_prefix(req.get_options().get('django.root', '')) |
150 | 150 | signals.request_started.send(sender=self.__class__) |
151 | 151 | try: |
152 | | try: |
153 | | request = self.request_class(req) |
154 | | except UnicodeDecodeError: |
155 | | logger.warning('Bad Request (UnicodeDecodeError)', |
156 | | exc_info=sys.exc_info(), |
157 | | extra={ |
158 | | 'status_code': 400, |
159 | | } |
160 | | ) |
161 | | response = http.HttpResponseBadRequest() |
162 | | else: |
163 | | response = self.get_response(request) |
| 152 | request = self.request_class(req) |
| 153 | response = self.get_response(request) |
164 | 154 | finally: |
165 | 155 | signals.request_finished.send(sender=self.__class__) |
166 | 156 | |
diff --git a/django/core/handlers/wsgi.py b/django/core/handlers/wsgi.py
index 56d2ba6..c121ce3 100644
a
|
b
|
class LimitedStream(object):
|
115 | 115 | class WSGIRequest(http.HttpRequest): |
116 | 116 | def __init__(self, environ): |
117 | 117 | script_name = base.get_script_name(environ) |
118 | | path_info = force_unicode(environ.get('PATH_INFO', u'/')) |
| 118 | path_info = force_unicode(environ.get('PATH_INFO', u'/'), errors='ignore') |
119 | 119 | if not path_info or path_info == script_name: |
120 | 120 | # Sometimes PATH_INFO exists, but is empty (e.g. accessing |
121 | 121 | # the SCRIPT_NAME URL without a trailing slash). We really need to |
… |
… |
class WSGIHandler(base.BaseHandler):
|
216 | 216 | set_script_prefix(base.get_script_name(environ)) |
217 | 217 | signals.request_started.send(sender=self.__class__) |
218 | 218 | try: |
219 | | try: |
220 | | request = self.request_class(environ) |
221 | | except UnicodeDecodeError: |
222 | | logger.warning('Bad Request (UnicodeDecodeError)', |
223 | | exc_info=sys.exc_info(), |
224 | | extra={ |
225 | | 'status_code': 400, |
226 | | } |
227 | | ) |
228 | | response = http.HttpResponseBadRequest() |
229 | | else: |
230 | | response = self.get_response(request) |
| 219 | request = self.request_class(environ) |
| 220 | response = self.get_response(request) |
231 | 221 | finally: |
232 | 222 | signals.request_finished.send(sender=self.__class__) |
233 | 223 | |