Skip to content

Commit 2e7fbcd

Browse files
Parameter to bypass CSP log deduplication
1 parent 37ce815 commit 2e7fbcd

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

core/src/org/labkey/core/admin/AdminController.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11965,8 +11965,12 @@ public Object execute(SimpleApiJsonForm form, BindException errors) throws Excep
1196511965
String urlString = cspReport.optString("document-uri", null);
1196611966
if (urlString != null)
1196711967
{
11968-
String path = new URLHelper(urlString).deleteParameters().getURIString();
11969-
if (null == reports.put(path, Boolean.TRUE) || _log.isDebugEnabled())
11968+
URLHelper urlHelper = new URLHelper(urlString);
11969+
// URL parameter that tells us to bypass suppression of redundant logging
11970+
// Used to make sure that tests of CSP logging are deterministic and convenient
11971+
boolean bypassCspDedupe = "true".equals(urlHelper.getParameter("bypassCspDedupe"));
11972+
String path = urlHelper.deleteParameters().getURIString();
11973+
if (null == reports.put(path, Boolean.TRUE) || _log.isDebugEnabled() || bypassCspDedupe)
1197011974
{
1197111975
// Don't modify forwarded reports; they already have user, ip, user-agent, etc. from the forwarding server.
1197211976
boolean forwarded = jsonObj.optBoolean("forwarded", false);

0 commit comments

Comments
 (0)