PySide6.QtNetwork.QHstsPolicy¶
- class QHstsPolicy¶
- The - QHstsPolicyclass specifies that a host supports HTTP Strict Transport Security policy (HSTS). More…- Synopsis¶- Methods¶- def - __init__()
- def - expiry()
- def - host()
- def - isExpired()
- def - __ne__()
- def - __eq__()
- def - setExpiry()
- def - setHost()
- def - swap()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- HSTS policy defines a period of time during which - QNetworkAccessManagershould only access a host in a secure fashion. HSTS policy is defined by RFC6797.- You can set expiry time and host name for this policy, and control whether it applies to subdomains, either in the constructor or by calling - setExpiry(),- setHost()and- setIncludesSubDomains().- See also - class PolicyFlag¶
- Constant - Description - QHstsPolicy.IncludeSubDomains - (inherits - enum.Flag) Indicates whether a policy must include subdomains
 - __init__()¶
 - Constructs an invalid (expired) policy with empty host name and subdomains not included. - __init__(rhs)
- Parameters:
- rhs – - QHstsPolicy
 
 - Creates a copy of - otherobject.- __init__(expiry, flags, host[, mode=QUrl.DecodedMode])
- Parameters:
- expiry – - QDateTime
- flags – Combination of - PolicyFlag
- host – str 
- mode – - ParsingMode
 
 
 - Constructs - QHstsPolicywith- expiry(in UTC);- flagsis a value indicating whether this policy must also include subdomains,- hostdata is interpreted according to- mode.- See also - Returns the expiration date for the policy (in UTC). - See also - host([options=QUrl.FullyDecoded])¶
- Parameters:
- options – Combination of - ComponentFormattingOption
- Return type:
- str 
 
 - Returns a host for a given policy, formatted according to - options.- See also - setHost()- ComponentFormattingOptions- includesSubDomains()¶
- Return type:
- bool 
 
 - Returns - trueif this policy also includes subdomains.- See also - isExpired()¶
- Return type:
- bool 
 
 - Return - trueif this policy has a valid expiration date and this date is greater than QDateTime::currentGetDateTimeUtc().- See also - __ne__(rhs)¶
- Parameters:
- rhs – - QHstsPolicy
- Return type:
- bool 
 
 - Returns - trueif the two policies- lhsand- rhsdo not have the same host or expiration date, or do not agree on whether to include or exclude subdomains.- __eq__(rhs)¶
- Parameters:
- rhs – - QHstsPolicy
- Return type:
- bool 
 
 - Returns - trueif the two policies- lhsand- rhshave the same host and expiration date while agreeing on whether to include or exclude subdomains.- Sets the expiration date for the policy (in UTC) to - expiry.- See also - setHost(host[, mode=QUrl.DecodedMode])¶
- Parameters:
- host – str 
- mode – - ParsingMode
 
 
 - Sets a host, - hostdata is interpreted according to- modeparameter.- See also - host()- ParsingMode- setIncludesSubDomains(include)¶
- Parameters:
- include – bool 
 
 - Sets whether subdomains are included for this policy to - include.- See also - swap(other)¶
- Parameters:
- other – - QHstsPolicy
 
 - Swaps this policy with - other. This operation is very fast and never fails.