public final class FeaturePolicyHeaderWriter extends java.lang.Object implements HeaderWriter
Feature Policy allows web developers to selectively enable, disable, and modify the behavior of certain APIs and web features in the browser.
A declaration of a feature policy contains a set of security policy directives, each responsible for declaring the restrictions for a particular feature type.
Constructor and Description |
---|
FeaturePolicyHeaderWriter(java.lang.String policyDirectives)
Create a new instance of
FeaturePolicyHeaderWriter with supplied security
policy directive(s). |
Modifier and Type | Method and Description |
---|---|
void |
setPolicyDirectives(java.lang.String policyDirectives)
Set the security policy directive(s) to be used in the response header.
|
java.lang.String |
toString() |
void |
writeHeaders(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Create a
Header instance. |
public FeaturePolicyHeaderWriter(java.lang.String policyDirectives)
FeaturePolicyHeaderWriter
with supplied security
policy directive(s).policyDirectives
- the security policy directive(s)java.lang.IllegalArgumentException
- if policyDirectives is null
or emptypublic void writeHeaders(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
HeaderWriter
Header
instance.writeHeaders
in interface HeaderWriter
request
- the requestresponse
- the responsepublic void setPolicyDirectives(java.lang.String policyDirectives)
policyDirectives
- the security policy directive(s)java.lang.IllegalArgumentException
- if policyDirectives is null
or emptypublic java.lang.String toString()
toString
in class java.lang.Object