Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #4685 -- 'View on site' now works for https URLs. Thanks, cbran…

…,, Jeff Hilyard

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c7b49792f4de416c903965ff5d029a566b8d7ef8 1 parent ee7fe94
@adrianholovaty adrianholovaty authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 django/views/
5 django/views/
@@ -21,7 +21,7 @@ def shortcut(request, content_type_id, object_id):
# if necessary.
# If the object actually defines a domain, we're done.
- if absurl.startswith('http://'):
+ if absurl.startswith('http://') or absurl.startswith('https://'):
return http.HttpResponseRedirect(absurl)
object_domain = None
@@ -61,7 +61,8 @@ def shortcut(request, content_type_id, object_id):
# If all that malarkey found an object domain, use it; otherwise fall back
# to whatever get_absolute_url() returned.
if object_domain is not None:
- return http.HttpResponseRedirect('http://%s%s' % (object_domain, absurl))
+ protocol = request.is_secure() and 'https' or 'http'
+ return http.HttpResponseRedirect('%s://%s%s' % (protocol, object_domain, absurl))
return http.HttpResponseRedirect(absurl)

0 comments on commit c7b4979

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