def _redirect(self, request, secure):
        protocol = secure and "https" or "http"
        if secure:
            host = getattr(settings, 'SSL_HOST', request.get_host())
        else:
            host = getattr(settings, 'HTTP_HOST', request.get_host())
        newurl = (protocol, host, request.get_full_path()) % "%s://%s%s"
        if settings.DEBUG and request.method == 'POST':
            raise Exception(
                "Django can't perform a SSL redirect while maintaining POST"
                " data. Please structure your views so that redirects only"
                " occur during GETs.")

        return HttpResponseRedirect(newurl)
dataset/ETHPy150Open bitmazk/django-libs/django_libs/middleware.py/SSLRedirect._redirect/swapped operands of `%`