### Struct

# Soup HSTSPolicy

since: 3.0

#### Description [src]

    struct SoupHSTSPolicy {
      /* No available fields */
    }

`SoupHSTSPolicy` implements HTTP policies, as described by RFC 6797.

`domain` represents the host that this policy applies to. The domain must be IDNA-canonicalized. `soup_hsts_policy_new()` and related methods will do this for you.

`max_age` contains the ‘max-age’ value from the Strict Transport Security header and indicates the time to live of this policy, in seconds.

`expires` will be non-`NULL` if the policy has been set by the host and hence has an expiry time. If `expires` is `NULL`, it indicates that the policy is a permanent session policy set by the user agent.

If `include_subdomains` is `TRUE`, the Strict Transport Security policy must also be enforced on subdomains of `domain`.

Available since: 3.0

#### Constructors

###### soup_hsts_policy_new

Creates a new `SoupHSTSPolicy` with the given attributes.

since: 3.0

###### soup_hsts_policy_new_from_response

Parses `msg`‘s first “Strict-Transport-Security” response header and returns a `SoupHSTSPolicy`.

since: 3.0

###### soup_hsts_policy_new_full

Full version of `soup_hsts_policy_new()`, to use with an existing expiration date.

since: 3.0

###### soup_hsts_policy_new_session_policy

Creates a new session `SoupHSTSPolicy` with the given attributes.

since: 3.0

#### Instance methods

###### soup_hsts_policy_copy

Copies `policy`.

since: 3.0

###### soup_hsts_policy_equal

Tests if `policy1` and `policy2` are equal.

since: 3.0

###### soup_hsts_policy_free

Frees `policy`.

since: 3.0

###### soup_hsts_policy_get_domain

Gets `policy`‘s domain.

since: 3.0

###### soup_hsts_policy_get_expires

Returns the expiration date for `policy`.

since: 3.0

###### soup_hsts_policy_get_max_age

Returns the max age for `policy`.

since: 3.0

###### soup_hsts_policy_includes_subdomains

Gets whether `policy` include its subdomains.

since: 3.0

###### soup_hsts_policy_is_expired

Gets whether `policy` is expired.

since: 3.0

###### soup_hsts_policy_is_session_policy

Gets whether `policy` is a non-permanent, non-expirable session policy.

since: 3.0