MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / reach

Function reach

tools/python-3.11.9-amd64/Lib/http/cookiejar.py:691–724  ·  view source on GitHub ↗

Return reach of host h, as defined by RFC 2965, section 1. The reach R of a host name H is defined as follows: * If - H is the host domain name of a host; and, - H has the form A.B; and - A has no embedded (that is, interior) dots; and

(h)

Source from the content-addressed store, hash-verified

689 return path
690
691def reach(h):
692 """Return reach of host h, as defined by RFC 2965, section 1.
693
694 The reach R of a host name H is defined as follows:
695
696 * If
697
698 - H is the host domain name of a host; and,
699
700 - H has the form A.B; and
701
702 - A has no embedded (that is, interior) dots; and
703
704 - B has at least one embedded dot, or B is the string "local".
705 then the reach of H is .B.
706
707 * Otherwise, the reach of H is H.
708
709 >>> reach("www.acme.com")
710 '.acme.com'
711 >>> reach("acme.com")
712 'acme.com'
713 >>> reach("acme.local")
714 '.local'
715
716 """
717 i = h.find(".")
718 if i >= 0:
719 #a = h[:i] # this line is only here to show what a is
720 b = h[i+1:]
721 i = b.find(".")
722 if is_HDN(h) and (i >= 0 or b == "local"):
723 return "."+b
724 return h
725
726def is_third_party(request):
727 """

Callers 1

is_third_partyFunction · 0.85

Calls 2

is_HDNFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected