public class CSP2Directive extends Object implements ICSPDirective
| Constructor and Description |
|---|
CSP2Directive(String sName,
CSP2SourceList aValue) |
CSP2Directive(String sName,
String sValue) |
| Modifier and Type | Method and Description |
|---|---|
static CSP2Directive |
createChildSrc(CSP2SourceList aValue)
Defines valid sources for web workers and nested browsing contexts loaded
using elements such as <frame> and <iframe>
|
static CSP2Directive |
createConnectSrc(CSP2SourceList aValue)
Applies to XMLHttpRequest (AJAX), WebSocket or EventSource.
|
static CSP2Directive |
createDefaultSrc(CSP2SourceList aValue)
The default-src is the default policy for loading content such as JavaScript,
Images, CSS, Fonts, AJAX requests, Frames, HTML5 Media.
|
static CSP2Directive |
createFontSrc(CSP2SourceList aValue)
Defines valid sources of fonts.
|
static CSP2Directive |
createFormAction(CSP2SourceList aValue)
Defines valid sources that can be used as a HTML <form> action.
|
static CSP2Directive |
createFrameAncestors(CSP2SourceList aValue)
Defines valid sources for embedding the resource using <frame>
<iframe> <object> <embed> <applet>.
|
static CSP2Directive |
createFrameSrc(CSP2SourceList aValue)
Deprecated.
|
static CSP2Directive |
createImgSrc(CSP2SourceList aValue)
Defines valid sources of images.
|
static CSP2Directive |
createMediaSrc(CSP2SourceList aValue)
Defines valid sources of audio and video, eg HTML5 <audio>,
<video> elements.
|
static CSP2Directive |
createObjectSrc(CSP2SourceList aValue)
Defines valid sources of plugins, eg <object>, <embed> or
<applet>.
|
static CSP2Directive |
createPluginTypes(CSP2SourceList aValue)
Defines valid MIME types for plugins invoked via <object> and
<embed>.
|
static CSP2Directive |
createReportURI(String sValue)
The report-uri directive specifies a URI to which the user agent sends
reports about policy violation.
|
static CSP2Directive |
createSandbox(String sValue)
The sandbox directive specifies an HTML sandbox policy that the user agent
applies to the protected resource.
|
static CSP2Directive |
createScriptSrc(CSP2SourceList aValue)
Defines valid sources of JavaScript.
|
static CSP2Directive |
createStyleSrc(CSP2SourceList aValue)
Defines valid sources of stylesheets.
|
boolean |
equals(Object o) |
String |
getName() |
String |
getValue() |
int |
hashCode() |
static boolean |
isValidName(String sName) |
static boolean |
isValidValue(String sValue) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAsString, getAsStringIfHasValue, hasValuepublic CSP2Directive(@Nonnull @Nonempty String sName, @Nullable CSP2SourceList aValue)
@Nonnull @Nonempty public final String getName()
getName in interface com.helger.commons.name.IHasNamegetName in interface ICSPDirective@Nullable public final String getValue()
getValue in interface ICSPDirectivenull or empty.@Nonnull public static CSP2Directive createDefaultSrc(@Nullable CSP2SourceList aValue)
aValue - Value list to use. May be be null.CSP2Directive@Nonnull public static CSP2Directive createScriptSrc(@Nullable CSP2SourceList aValue)
aValue - Value list to use. May be be null.CSP2Directive@Nonnull public static CSP2Directive createStyleSrc(@Nullable CSP2SourceList aValue)
aValue - Value list to use. May be be null.CSP2Directive@Nonnull public static CSP2Directive createImgSrc(@Nullable CSP2SourceList aValue)
aValue - Value list to use. May be be null.CSP2Directive@Nonnull public static CSP2Directive createConnectSrc(@Nullable CSP2SourceList aValue)
aValue - Value list to use. May be be null.CSP2Directive@Nonnull public static CSP2Directive createFontSrc(@Nullable CSP2SourceList aValue)
aValue - Value list to use. May be be null.CSP2Directive@Nonnull public static CSP2Directive createObjectSrc(@Nullable CSP2SourceList aValue)
aValue - Value list to use. May be be null.CSP2Directive@Nonnull public static CSP2Directive createMediaSrc(@Nullable CSP2SourceList aValue)
aValue - Value list to use. May be be null.CSP2Directive@Deprecated @Nonnull public static CSP2Directive createFrameSrc(@Nullable CSP2SourceList aValue)
aValue - Value list to use. May be be null.CSP2Directive@Nonnull public static CSP2Directive createSandbox(@Nullable String sValue)
sValue - value@Nonnull public static CSP2Directive createReportURI(@Nullable String sValue)
sValue - Report URI@Nonnull public static CSP2Directive createChildSrc(@Nullable CSP2SourceList aValue)
aValue - Value list to use. May be be null.CSP2Directive@Nonnull public static CSP2Directive createFormAction(@Nullable CSP2SourceList aValue)
aValue - Value list to use. May be be null.CSP2Directive@Nonnull public static CSP2Directive createFrameAncestors(@Nullable CSP2SourceList aValue)
'none' should be roughly equivalent to
X-Frame-Options: DENYaValue - Value list to use. May be be null.CSP2Directive@Nonnull public static CSP2Directive createPluginTypes(@Nullable CSP2SourceList aValue)
application/x-java-applet.aValue - Value list to use. May be be null.CSP2DirectiveCopyright © 2016–2019 Philip Helger. All rights reserved.