Soup.HSTSEnforcer.set_policy

### Method

# Soup HSTSEnforcerset_policy

#### Declaration [src]

    void
    soup_hsts_enforcer_set_policy (
      SoupHSTSEnforcer* hsts_enforcer,
      SoupHSTSPolicy* policy
    )

#### Description [src]

Sets `policy` to `hsts_enforcer`.

If `policy` is expired, any existing HSTS policy for its host will be removed instead. If a policy existed for this host, it will be replaced. Otherwise, the new policy will be inserted. If the policy is a session policy, that is, one created with `soup_hsts_policy_new_session_policy()`, the policy will not expire and will be enforced during the lifetime of `hsts_enforcer`‘s `SoupSession`.

#### Parameters

`policy`

  Type: `SoupHSTSPolicy`

  The policy of the HSTS host.

  The data is owned by the caller of the method.