public final class ClearSiteDataHeaderWriter extends java.lang.Object implements HeaderWriter
Developers may instruct a user agent to clear various types of relevant data by delivering a Clear-Site-Data HTTP response header in response to a request.
Due to Incomplete Clearing section the header is only applied if the request is secure.
Modifier and Type | Class and Description |
---|---|
static class |
ClearSiteDataHeaderWriter.Directive
Represents the directive values expected by the
ClearSiteDataHeaderWriter . |
Constructor and Description |
---|
ClearSiteDataHeaderWriter(ClearSiteDataHeaderWriter.Directive... directives)
Creates a new instance of
ClearSiteDataHeaderWriter with given sources. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
toString() |
void |
writeHeaders(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Create a
Header instance. |
public ClearSiteDataHeaderWriter(ClearSiteDataHeaderWriter.Directive... directives)
Creates a new instance of ClearSiteDataHeaderWriter
with given sources. The
constructor also initializes requestMatcher with a new instance of
SecureRequestMatcher to ensure that header is only applied if and when the
request is secure as per the Incomplete Clearing section.
directives
- (i.e. "cache", "cookies", "storage", "executionContexts" or "*")java.lang.IllegalArgumentException
- if sources is null or empty.public void writeHeaders(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
HeaderWriter
Header
instance.writeHeaders
in interface HeaderWriter
request
- the requestresponse
- the responsepublic java.lang.String toString()
toString
in class java.lang.Object