Ticket #4685: check_protocol.diff

File check_protocol.diff, 669 bytes (added by treborhudson@…, 17 years ago)

Patch attempt, needs testing

  • django/views/defaults.py

     
    6161    # If all that malarkey found an object domain, use it; otherwise fall back
    6262    # to whatever get_absolute_url() returned.
    6363    if object_domain is not None:
    64         return http.HttpResponseRedirect('http://%s%s' % (object_domain, absurl))
     64        protocol = request.is_secure() and 'https' or 'http'
     65        return http.HttpResponseRedirect('%s://%s%s' % (protocol, object_domain, absurl))
    6566    else:
    6667        return http.HttpResponseRedirect(absurl)
    6768
Back to Top