#10401 closed (duplicate)
Very long URL cause django error.
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | HTTP handling | Version: | 1.0 |
Severity: | Keywords: | handler404 | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I have configed the right handler404 for pages mismatching all the regular expressions in urls.py and it often worked fine.
However when I entered a very long URLs with characters more than 250, the folloing error information would be listed:
======================================================
Traceback (most recent call last):
File "/var/lib/python-support/python2.5/django/core/servers/basehttp.py", line 277, in run
self.result = application(self.environ, self.start_response)
File "/var/lib/python-support/python2.5/django/core/servers/basehttp.py", line 634, in call
return self.application(environ, start_response)
File "/var/lib/python-support/python2.5/django/core/handlers/wsgi.py", line 239, in call
response = self.get_response(request)
File "/var/lib/python-support/python2.5/django/core/handlers/base.py", line 67, in get_response
response = middleware_method(request)
File "/var/lib/python-support/python2.5/django/middleware/cache.py", line 125, in process_request
cache_key = get_cache_key(request, self.key_prefix)
File "/var/lib/python-support/python2.5/django/utils/cache.py", line 163, in get_cache_key
headerlist = cache.get(cache_key, None)
File "/var/lib/python-support/python2.5/django/core/cache/backends/memcached.py", line 25, in get
val = self._cache.get(smart_str(key))
File "/var/lib/python-support/python2.5/memcache.py", line 619, in get
check_key(key)
File "/var/lib/python-support/python2.5/memcache.py", line 886, in check_key
% SERVER_MAX_KEY_LENGTH)
MemcachedKeyLengthError: Key length is > 250
======================================================
The above exception should be handled and be taken by handler404.
Moreover, I test www.djangoproject.com, when I checked http://www.djangoproject.com/ladjflkjlkjlk, it gave me the right 404 page.
My platform is FreeBSD 6.2, python 2.5.2, django 1.0.2.
Duplicate of #10016