diff --git a/django/core/handlers/modpython.py b/django/core/handlers/modpython.py
index 7b25f0e..3ba5a3b 100755
a
|
b
|
class ModPythonRequest(http.HttpRequest):
|
33 | 33 | # circumstances (it's out of mod_python's control a bit), so we use |
34 | 34 | # req.uri and some string manipulations to get the right value. |
35 | 35 | if root and req.uri.startswith(root): |
36 | | self.path_info = force_unicode(req.uri[len(root):]) |
| 36 | self.path_info = force_unicode(req.uri[len(root):], errors='ignore') |
37 | 37 | else: |
38 | 38 | self.path_info = self.path |
39 | 39 | if not self.path_info: |
… |
… |
class ModPythonHandler(BaseHandler):
|
176 | 176 | set_script_prefix(req.get_options().get('django.root', '')) |
177 | 177 | signals.request_started.send(sender=self.__class__) |
178 | 178 | try: |
179 | | try: |
180 | | request = self.request_class(req) |
181 | | except UnicodeDecodeError: |
182 | | logger.warning('Bad Request (UnicodeDecodeError): %s' % request.path, |
183 | | exc_info=sys.exc_info(), |
184 | | extra={ |
185 | | 'status_code': 400, |
186 | | 'request': request |
187 | | } |
188 | | ) |
189 | | response = http.HttpResponseBadRequest() |
190 | | else: |
191 | | response = self.get_response(request) |
| 179 | request = self.request_class(req) |
| 180 | response = self.get_response(request) |
192 | 181 | finally: |
193 | 182 | signals.request_finished.send(sender=self.__class__) |
194 | 183 | |
diff --git a/django/core/handlers/wsgi.py b/django/core/handlers/wsgi.py
index 537154c..24bf5dd 100755
a
|
b
|
class LimitedStream(object):
|
117 | 117 | class WSGIRequest(http.HttpRequest): |
118 | 118 | def __init__(self, environ): |
119 | 119 | script_name = base.get_script_name(environ) |
120 | | path_info = force_unicode(environ.get('PATH_INFO', u'/')) |
| 120 | path_info = force_unicode(environ.get('PATH_INFO', u'/'), errors='ignore') |
121 | 121 | if not path_info or path_info == script_name: |
122 | 122 | # Sometimes PATH_INFO exists, but is empty (e.g. accessing |
123 | 123 | # the SCRIPT_NAME URL without a trailing slash). We really need to |
… |
… |
class WSGIHandler(base.BaseHandler):
|
258 | 258 | set_script_prefix(base.get_script_name(environ)) |
259 | 259 | signals.request_started.send(sender=self.__class__) |
260 | 260 | try: |
261 | | try: |
262 | | request = self.request_class(environ) |
263 | | except UnicodeDecodeError: |
264 | | logger.warning('Bad Request (UnicodeDecodeError): %s' % request.path, |
265 | | exc_info=sys.exc_info(), |
266 | | extra={ |
267 | | 'status_code': 400, |
268 | | 'request': request |
269 | | } |
270 | | ) |
271 | | response = http.HttpResponseBadRequest() |
272 | | else: |
273 | | response = self.get_response(request) |
| 261 | request = self.request_class(environ) |
| 262 | response = self.get_response(request) |
274 | 263 | finally: |
275 | 264 | signals.request_finished.send(sender=self.__class__) |
276 | 265 | |