mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
[soc2009/http-wsgi-improvements] Fixes for HttpResponse.charsets docs and HttpResponse._charset. Refs #10190.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/http-wsgi-improvements@11370 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
019d20a465
commit
edcc1c2e7e
@ -278,7 +278,7 @@ class HttpResponse(object):
|
||||
content_type=None, request=None):
|
||||
from django.conf import settings
|
||||
accept_charset = None
|
||||
_charset = settings.DEFAULT_CHARSET
|
||||
self._charset = settings.DEFAULT_CHARSET
|
||||
if mimetype:
|
||||
content_type = mimetype # Mimetype arg is an alias for content-type
|
||||
if request:
|
||||
@ -503,12 +503,6 @@ class HttpResponseNotAllowed(HttpResponse):
|
||||
HttpResponse.__init__(self)
|
||||
self['Allow'] = ', '.join(permitted_methods)
|
||||
|
||||
class HttpResponseNotAcceptable(HttpResponse):
|
||||
_status_code = 406
|
||||
|
||||
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
|
||||
# if we want to make this more verbose (compliant, actually)
|
||||
|
||||
class HttpResponseGone(HttpResponse):
|
||||
_status_code = 410
|
||||
|
||||
|
@ -240,7 +240,7 @@ def get_codec(charset):
|
||||
http://www.iana.org/assignments/character-sets contains valid aliases.
|
||||
The documentation for the codecs module has the list of codecs.
|
||||
|
||||
CODEC_CHARSETS above has the codecs that correspond to character sets.
|
||||
_CHARSET_CODECS above has the codecs that correspond to character sets.
|
||||
"""
|
||||
codec = None
|
||||
if charset:
|
||||
@ -324,7 +324,6 @@ def get_response_encoding(content_type, accept_charset_header):
|
||||
# code in the HttpResponse.
|
||||
return charset, codec
|
||||
|
||||
# NOTE -- make sure we are not duping the processing of q values
|
||||
def _process_accept_charset(accept_charset):
|
||||
'''
|
||||
HTTP RFC 2616 section 14.2 dictates that q must be between 0 and 1.
|
||||
|
Loading…
x
Reference in New Issue
Block a user