def process_response(self, request, response):
        if response['Content-Type'].find('html') >= 0:
            protocol = request.META.get("HTTP_X_FORWARDED_PROTO", "http")
            #Only deal with https.
            if protocol == "http":
                return response

            def rewrite_url(match):
                attribute = match.groupdict()["attribute"]
                split_url = urlsplit(match.groupdict()["url"])
                if split_url.scheme == 'javascript' and request.path.startswith(reverse('admin:index')):
                    return '%s="%s"' % (attribute, split_url.geturl())
                host = split_url.netloc if split_url.netloc else settings.HTTP_HOST
                request_path = request.path if request.path and request.path[-1] != "/" else request.path[:-1]
                path = split_url.path if split_url.path and split_url.path[0] == "/" else (request_path, split_url.path) % "%s/%s"
                new_url = urlunsplit((protocol, host, path, split_url[3],split_url[4]))
                return '%s="%s"' % (attribute, new_url)
            try:
                decoded_content = response.content.decode('utf-8')
            except UnicodeDecodeError:
                decoded_content = response.content
            response.content = \
                HREF_PATTERN.sub(rewrite_url, decoded_content).encode('utf-8')
        return response
dataset/ETHPy150Open jumoconnect/openjumo/jumodjango/etc/middleware.py/SSLMiddleware.process_response/swapped operands of `%`