MCPcopy Index your code
hub / github.com/python/cpython / request_port

Function request_port

Lib/http/cookiejar.py:658–670  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

656 return path
657
658def request_port(request):
659 host = request.host
660 i = host.find(':')
661 if i >= 0:
662 port = host[i+1:]
663 try:
664 int(port)
665 except ValueError:
666 _debug("nonnumeric port: '%s'", port)
667 return None
668 else:
669 port = DEFAULT_HTTP_PORT
670 return port
671
672# Characters in addition to A-Z, a-z, 0-9, '_', '.', and '-' that don't
673# need to be escaped to form a valid HTTP URL (RFCs 2396 and 1738).

Callers 4

test_request_portMethod · 0.90
set_ok_portMethod · 0.85
return_ok_portMethod · 0.85

Calls 2

_debugFunction · 0.85
findMethod · 0.45

Tested by 1

test_request_portMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…