Repository navigation
N°9477 - improve documents output - #1066
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new test uses an undefined variable and does not verify the newly added CSP directive.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Improves inline document security headers and removes obsolete XSS filtering.
Changes:
- Adds
default-src 'none'to the document CSP. - Removes legacy script filtering.
- Adds a regression test for document response headers.
| File | Description |
|---|---|
tests/php-unit-tests/unitary-tests/pages/AjaxRenderTest.php |
Tests document CSP headers. |
sources/Application/WebPage/DownloadPage.php |
Outputs document content directly. |
sources/Application/WebPage/AjaxPage.php |
Removes legacy XSS filter. |
pages/ajax.render.php |
Strengthens inline-document CSP. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
@jf-cbd please mind to name the PR correctly, not straight out of the branch name. (Among other considerations, it won't appear in the corresponding ticket once merged) :) |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused security-header enhancement and cleanup are consistent with the document delivery flow and covered by a regression test.
Review effort: Balanced
Findings: None


Base information
Symptom (bug) / Objective (enhancement)
Add unit test to ensure sandboxing is present, add some more default-src info, remove old code
Reproduction procedure (enhancement - if needed)
On iTop 3.2.3, create a DocumentFile, upload a picture and open it. See in the network console that the request have CSP sandboxing as well as "default-src 'none' " instruction.
Proposed solution (bug and enhancement)
Add more header details, add unit test, to avoid regression, clean code.
Checklist before requesting a review