QHstsPolicyclass specifies that a host supports HTTP Strict Transport Security policy (HSTS). 更多 …
New in version 5.9.
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().
QHstsPolicy
¶
QHstsPolicy(expiry, flags, host[, mode=QUrl.DecodedMode])
QHstsPolicy(rhs)
- param host
unicode
- param flags
PolicyFlags- param expiry
QDateTime- param rhs
- param mode
ParsingMode
Constructs an invalid (expired) policy with empty host name and subdomains not included.
Constructs
QHstsPolicy
with
expiry
(in UTC);
flags
is a value indicating whether this policy must also include subdomains,
host
data is interpreted according to
mode
.
另请参阅
setHost()
ParsingMode
PolicyFlag
Creates a copy of
other
对象。
PySide2.QtNetwork.QHstsPolicy.
PolicyFlag
¶
|
常量 |
描述 |
|---|---|
|
QHstsPolicy.IncludeSubDomains |
Indicates whether a policy must include subdomains |
PySide2.QtNetwork.QHstsPolicy.
expiry
(
)
¶
QDateTime
Returns the expiration date for the policy (in UTC).
另请参阅
PySide2.QtNetwork.QHstsPolicy.
host
(
[
options=QUrl.FullyDecoded
]
)
¶
options
–
ComponentFormattingOptions
unicode
Returns a host for a given policy, formatted according to
options
.
另请参阅
setHost()
host()
ComponentFormattingOptions
PySide2.QtNetwork.QHstsPolicy.
includesSubDomains
(
)
¶
bool
返回
true
if this policy also includes subdomains.
PySide2.QtNetwork.QHstsPolicy.
isExpired
(
)
¶
bool
返回
true
if this policy has a valid expiration date and this date is greater than QDateTime::currentGetDateTimeUtc().
另请参阅
PySide2.QtNetwork.QHstsPolicy.
__ne__
(
rhs
)
¶
rhs
–
QHstsPolicy
bool
PySide2.QtNetwork.QHstsPolicy.
__eq__
(
rhs
)
¶
rhs
–
QHstsPolicy
bool
PySide2.QtNetwork.QHstsPolicy.
setExpiry
(
expiry
)
¶
expiry
–
QDateTime
Sets the expiration date for the policy (in UTC) to
expiry
.
另请参阅
PySide2.QtNetwork.QHstsPolicy.
setHost
(
host
[
,
mode=QUrl.DecodedMode
]
)
¶
host – unicode
mode
–
ParsingMode
Sets a host,
host
data is interpreted according to
mode
参数。
另请参阅
host()
setHost()
ParsingMode
PySide2.QtNetwork.QHstsPolicy.
setIncludesSubDomains
(
include
)
¶
include
–
bool
Sets whether subdomains are included for this policy to
include
.
另请参阅
PySide2.QtNetwork.QHstsPolicy.
swap
(
other
)
¶
other
–
QHstsPolicy
Swaps this policy with the
other
policy.