Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.3.x] Fixed #18692 -- Restored python 2.4 compatibility.

Thanks to chipx86 for the report.
  • Loading branch information...
commit d0d5dc6cd76f01c8a71b677357ad2f702cb54416 1 parent e2ac917
Florian Apolloner authored August 01, 2012
4  django/http/__init__.py
@@ -642,8 +642,8 @@ class HttpResponseRedirectBase(HttpResponse):
642 642
     def __init__(self, redirect_to):
643 643
         super(HttpResponseRedirectBase, self).__init__()
644 644
         parsed = urlparse(redirect_to)
645  
-        if parsed.scheme and parsed.scheme not in self.allowed_schemes:
646  
-            raise SuspiciousOperation("Unsafe redirect to URL with scheme '%s'" % parsed.scheme)
  645
+        if parsed[0] and parsed[0] not in self.allowed_schemes:
  646
+            raise SuspiciousOperation("Unsafe redirect to URL with scheme '%s'" % parsed[0])
647 647
         self['Location'] = iri_to_uri(redirect_to)
648 648
 
649 649
 class HttpResponseRedirect(HttpResponseRedirectBase):
2  django/http/utils.py
@@ -76,7 +76,7 @@ def fix_IE_for_vary(request, response):
76 76
 
77 77
     # The first part of the Content-Type field will be the MIME type,
78 78
     # everything after ';', such as character-set, can be ignored.
79  
-    mime_type = response.get('Content-Type', '').partition(';')[0]
  79
+    mime_type = response.get('Content-Type', '').split(';', 1)[0]
80 80
     if mime_type not in safe_mime_types:
81 81
         try:
82 82
             del response['Vary']

0 notes on commit d0d5dc6

Please sign in to comment.
Something went wrong with that request. Please try again.