How to use the hyperlink.DecodedURL.fromText function in hyperlink

To help you get started, we’ve selected a few hyperlink examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github twisted / klein / src / klein / _request_compat.py View on Github external
netloc = nativeString(request.getRequestHostname())

        port = request.getHost().port
        if request.isSecure():
            default = 443
        else:
            default = 80
        if port != default:
            netloc += u":{}".format(port)

        path = nativeString(request.uri)
        if path and path[0] == u"/":
            path = path[1:]

        return DecodedURL.fromText(u"{}://{}/{}".format(scheme, netloc, path))

hyperlink

A featureful, immutable, and correct URL for Python.

MIT
Latest version published 4 years ago

Package Health Score

73 / 100
Full package analysis