コード例 #1
0
    def _transform_uri(self, uri):
        scheme = urllib.splittype(uri)[0]

        if scheme == 'httprpc' or scheme.startswith('httprpc+'):
            # Try find HTTPRPC transport (token after '+' in 'httprpc+https'), otherwise assume HTTP
            transport = scheme[scheme.index('+') + 1:] if '+' in scheme else 'http'

            # Transform URI with new path and scheme
            uri = join_uri(uri, 'plugins/httprpc/action.php', construct=False)
            return update_uri(uri, scheme=transport)

        return uri
コード例 #2
0
    def _transform_uri(self, uri):
        scheme = urlparse(uri)[0]

        if scheme == 'httprpc' or scheme.startswith('httprpc+'):
            # Try find HTTPRPC transport (token after '+' in 'httprpc+https'), otherwise assume HTTP
            transport = scheme[scheme.index('+') + 1:] if '+' in scheme else 'http'

            # Transform URI with new path and scheme
            uri = join_uri(uri, 'plugins/httprpc/action.php', construct=False)
            return update_uri(uri, scheme=transport)

        return uri