Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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))