File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -642,8 +642,8 @@ class HttpResponseRedirectBase(HttpResponse):
642642 def __init__ (self , redirect_to ):
643643 super (HttpResponseRedirectBase , self ).__init__ ()
644644 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 ] )
647647 self ['Location' ] = iri_to_uri (redirect_to )
648648
649649class HttpResponseRedirect (HttpResponseRedirectBase ):
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ def fix_IE_for_vary(request, response):
7676
7777 # The first part of the Content-Type field will be the MIME type,
7878 # 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 ]
8080 if mime_type not in safe_mime_types :
8181 try :
8282 del response ['Vary' ]
You can’t perform that action at this time.
0 commit comments