Lines Matching refs:domain
20 // PublicSuffixList provides the public suffix of a domain. For example:
35 // PublicSuffix returns the public suffix of domain.
40 PublicSuffix(domain string) string
51 // an HTTP server can set a cookie for a domain.
67 // their name/domain/path.
94 Domain string
110 // Id returns the domain;path;name triple of e as an id.
112 return fmt.Sprintf("%s;%s;%s", e.Domain, e.Path, e.Name)
122 // domainMatch implements "domain-match" of RFC 6265 section 5.1.3.
124 if e.Domain == host {
127 return !e.HostOnly && hasDotSuffix(host, e.Domain)
313 // Strip trailing dot from fully qualified domain names.
385 // be valid to call e.id (which depends on e's Name, Domain and Path).
387 // A malformed c.Domain will result in an error.
397 e.Domain, e.HostOnly, err = j.domainAndType(host, c.Domain)
429 errIllegalDomain = errors.New("cookiejar: illegal cookie domain attribute")
430 errMalformedDomain = errors.New("cookiejar: malformed cookie domain attribute")
439 // domainAndType determines the cookie's domain and hostOnly attribute.
440 func (j *Jar) domainAndType(host, domain string) (string, bool, error) {
441 if domain == "" {
442 // No domain attribute in the SetCookie header indicates a
448 // According to RFC 6265 domain-matching includes not being
454 // From here on: If the cookie is valid, it is a domain cookie (with
457 if domain[0] == '.' {
458 domain = domain[1:]
461 if len(domain) == 0 || domain[0] == '.' {
462 // Received either "Domain=." or "Domain=..some.thing",
466 domain = strings.ToLower(domain)
468 if domain[len(domain)-1] == '.' {
469 // We received stuff like "Domain=www.example.com.".
473 // "Domain Matching" (5.1.3) and "Canonicalized Host Names"
480 if ps := j.psList.PublicSuffix(domain); ps != "" && !hasDotSuffix(domain, ps) {
481 if host == domain {
483 // with a domain attribute is a host cookie.
490 // The domain must domain-match host: www.mycompany.com cannot
492 if host != domain && !hasDotSuffix(host, domain) {
496 return domain, false, nil