Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minor cleanup in the WSGI handler.

  • Loading branch information...
commit ae7f9afaf6592fa477792647bd8cee0a8560b4eb 1 parent 4e88d10
@aaugustin aaugustin authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 django/core/handlers/wsgi.py
View
6 django/core/handlers/wsgi.py
@@ -93,7 +93,7 @@ def __init__(self, environ):
self.META['PATH_INFO'] = path_info
self.META['SCRIPT_NAME'] = script_name
self.method = environ['REQUEST_METHOD'].upper()
- _, content_params = self._parse_content_type(self.META.get('CONTENT_TYPE', ''))
+ _, content_params = self._parse_content_type(environ.get('CONTENT_TYPE', ''))
if 'charset' in content_params:
try:
codecs.lookup(content_params['charset'])
@@ -103,7 +103,7 @@ def __init__(self, environ):
self.encoding = content_params['charset']
self._post_parse_error = False
try:
- content_length = int(self.environ.get('CONTENT_LENGTH'))
+ content_length = int(environ.get('CONTENT_LENGTH'))
except (ValueError, TypeError):
content_length = 0
self._stream = LimitedStream(self.environ['wsgi.input'], content_length)
@@ -111,7 +111,7 @@ def __init__(self, environ):
self.resolver_match = None
def _is_secure(self):
- return 'wsgi.url_scheme' in self.environ and self.environ['wsgi.url_scheme'] == 'https'
+ return self.environ.get('wsgi.url_scheme') == 'https'
def _parse_content_type(self, ctype):
"""
Please sign in to comment.
Something went wrong with that request. Please try again.