See http://code.djangoproject.com/browser/django/trunk/django/http/__init__.py#L160