-
Notifications
You must be signed in to change notification settings - Fork 10
CSP reports don't get reported locally if using a contextPath #1101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…sing a contextPath
labkey-matthewb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, this might not be right. This CSP will also be used for static pages. In that case this might be a nonsense URL. E.g. looks like an ActionURL with an improper container path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CSPs in application.properties are only used for dev enlistments, which use a root contextPath without some modification to the file. If they do that, I think it's reasonable to expect them to modify the CSP as well.
The CSP defined in Java has access to the contextPath and could just include it in the CSP's report-uri, right?
labkey-tchad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spring boot support property interpolation. If we prepend the report URI with ${context.contextPath:}, it will fill in the context path (if it is defined)
Given that these are dev-only and short lived (removed starting in 25.6), and the fact that @labkey-willm automation relies on this URI (I think), I'm going to leave the |
Co-authored-by: Trey Chadick <[email protected]>
Approach was changed to continue to use an absolute URI but explicitly include the context path |
Rationale
https://www.labkey.org/home/Developer/issues/issues-details.view?issueId=53319
Adding the context path to the
report-uridoes the trick -- tested both with and without a context path. Note: for this to work correctly, any providedcontextPathvalue must start with a slash. Credit to @labkey-tchad for current approach.Related Pull Requests