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

Method set_ok_port

Lib/http/cookiejar.py:1076–1095  ·  view source on GitHub ↗
(self, cookie, request)

Source from the content-addressed store, hash-verified

1074 return True
1075
1076 def set_ok_port(self, cookie, request):
1077 if cookie.port_specified:
1078 req_port = request_port(request)
1079 if req_port is None:
1080 req_port = "80"
1081 else:
1082 req_port = str(req_port)
1083 for p in cookie.port.split(","):
1084 try:
1085 int(p)
1086 except ValueError:
1087 _debug(" bad port %s (not numeric)", p)
1088 return False
1089 if p == req_port:
1090 break
1091 else:
1092 _debug(" request port (%s) not found in %s",
1093 req_port, cookie.port)
1094 return False
1095 return True
1096
1097 def return_ok(self, cookie, request):
1098 """

Callers

nothing calls this directly

Calls 4

request_portFunction · 0.85
strFunction · 0.85
_debugFunction · 0.85
splitMethod · 0.45

Tested by

no test coverage detected