Package org.apache.wicket.csp
Class RelativeURICSPValue
- java.lang.Object
-
- org.apache.wicket.csp.RelativeURICSPValue
-
- All Implemented Interfaces:
CSPRenderable
public class RelativeURICSPValue extends Object implements CSPRenderable
A CSP value that renders an URI relative to the context root of the Wicket application.- Author:
- papegaaij
-
-
Constructor Summary
Constructors Constructor Description RelativeURICSPValue(String relativeUri)
Creates a newRelativeURICSPValue
for the given relative URI.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkValidityForSrc()
Checks if theCSPRenderable
represents a valid value for a-src
directive.String
render(ContentSecurityPolicySettings settings, RequestCycle cycle)
Renders the value that should be put in the CSP header.String
toString()
-
-
-
Constructor Detail
-
RelativeURICSPValue
public RelativeURICSPValue(String relativeUri)
Creates a newRelativeURICSPValue
for the given relative URI.- Parameters:
relativeUri
- The part of the URI relative to the context root of the Wicket application.
-
-
Method Detail
-
render
public String render(ContentSecurityPolicySettings settings, RequestCycle cycle)
Description copied from interface:CSPRenderable
Renders the value that should be put in the CSP header.- Specified by:
render
in interfaceCSPRenderable
- Parameters:
settings
- TheContentSecurityPolicySettings
that renders this value.cycle
- The currentRequestCycle
.- Returns:
- The rendered value.
-
checkValidityForSrc
public void checkValidityForSrc()
Description copied from interface:CSPRenderable
Checks if theCSPRenderable
represents a valid value for a-src
directive. By default no checks are performed.- Specified by:
checkValidityForSrc
in interfaceCSPRenderable
-
-