use of act.handler.RequestHandler in project actframework by actframework.
the class ActionContext method applyContentSecurityPolicy.
public ActionContext applyContentSecurityPolicy() {
RequestHandler handler = handler();
if (null != handler) {
boolean disableCSP = handler.disableContentSecurityPolicy();
if (disableCSP) {
return this;
}
String csp = handler.contentSecurityPolicy();
if (S.notBlank(csp)) {
H.Response resp = resp();
resp.addHeaderIfNotAdded(CONTENT_SECURITY_POLICY, csp);
}
}
applyGlobalCspSetting();
return this;
}
Aggregations