Skip to content

Commit 78b6341

Browse files
authored
Add ContentSecurityPolicyFilter.registerAllowedSources() (#239)
* Add ContentSecurityPolicyFilter.registerAllowedSources() * Modify ContentSecurityPolicyFilter
1 parent b2d159b commit 78b6341

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

mGAP/src/org/labkey/mgap/mGAPModule.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.labkey.api.ldk.notification.NotificationService;
3636
import org.labkey.api.module.ModuleContext;
3737
import org.labkey.api.query.FieldKey;
38+
import org.labkey.api.security.Directive;
3839
import org.labkey.api.sequenceanalysis.SequenceAnalysisService;
3940
import org.labkey.api.sequenceanalysis.pipeline.SequencePipelineService;
4041
import org.labkey.api.util.PageFlowUtil;
@@ -107,7 +108,9 @@ public void doStartupAfterSpringConfig(ModuleContext moduleContext)
107108

108109
SystemMaintenance.addTask(new mGapMaintenanceTask());
109110

110-
ContentSecurityPolicyFilter.registerAllowedConnectionSource(this.getClass().getName(), "https://*.fontawesome.com", "https://code.jquery.com", "https://www.gstatic.com");
111+
ContentSecurityPolicyFilter.registerAllowedSources(Directive.Connection, this.getClass().getName(), "https://code.jquery.com", "https://*.fontawesome.com");
112+
ContentSecurityPolicyFilter.registerAllowedSources(Directive.Style, this.getClass().getName(), "https://code.jquery.com", "https://www.gstatic.com");
113+
ContentSecurityPolicyFilter.registerAllowedSources(Directive.Font, this.getClass().getName(), "https://*.fontawesome.com");
111114

112115
new PipelineStartup();
113116
}

mcc/src/org/labkey/mcc/MccModule.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.labkey.api.module.ModuleContext;
3030
import org.labkey.api.query.DefaultSchema;
3131
import org.labkey.api.query.QuerySchema;
32+
import org.labkey.api.security.Directive;
3233
import org.labkey.api.security.permissions.ReadPermission;
3334
import org.labkey.api.security.roles.RoleManager;
3435
import org.labkey.api.study.Study;
@@ -137,7 +138,9 @@ protected void doStartupAfterSpringConfig(ModuleContext moduleContext)
137138

138139
SystemMaintenance.addTask(new MccMaintenanceTask());
139140

140-
ContentSecurityPolicyFilter.registerAllowedConnectionSource(this.getClass().getName(), "https://cdn.datatables.net");
141+
ContentSecurityPolicyFilter.registerAllowedSources(Directive.Connection, this.getClass().getName(), "https://cdn.datatables.net");
142+
ContentSecurityPolicyFilter.registerAllowedSources(Directive.Style, this.getClass().getName(), "https://cdn.datatables.net");
143+
ContentSecurityPolicyFilter.registerAllowedSources(Directive.Image, this.getClass().getName(), "https://cdn.datatables.net");
141144
}
142145

143146
@Override

0 commit comments

Comments
 (0)