Function
mechanize._clientcookie.domain_match

Signature

domain_match(A, B)

Documentation String

Return True if domain A domain-matches domain B, according to RFC 2965.

A and B may be host domain names or IP addresses.

RFC 2965, section 1:

Host names can be specified either as an IP address or a HDN string. Sometimes we compare one host name with another. (Such comparisons SHALL be case-insensitive.) Host A's name domain-matches host B's if

  • their host name strings string-compare equal; or
  • A is a HDN string and has the form NB, where N is a non-empty name string, B has the form .B', and B' is a HDN string. (So, x.y.com domain-matches .Y.com but not Y.com.)

Note that domain-match is not a commutative operation: a.b.c.com domain-matches .c.com, but not the reverse.