Bugfix/data directive#186
Merged
GaProgMan merged 7 commits intoAug 28, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the documentation and testing for Content-Security-Policy (CSP) header generation, specifically clarifying the difference between directive keywords and URI sources in CSP configuration.
- Adds comprehensive XML documentation to
ContentSecurityPolicyElementandCspCommandTypeenum explaining when to use each type - Modernizes test code by replacing
new List<>with collection expressions ([]) - Adds four new regression tests that verify proper quoting behavior for directive vs URI elements
- Updates documentation with detailed examples of CSP directive and URI configuration patterns
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/OwaspHeaders.Core.Tests/RegressionTests/CspRegressionTests.cs |
Updates existing tests to use collection expressions and adds new tests verifying CSP directive/URI quoting behavior |
src/OwaspHeaders.Core.csproj |
Bumps patch version from 9.8.1 to 9.8.2 |
src/Models/ContentSecurityPolicyElement.cs |
Adds XML documentation explaining the purpose and usage of CommandType and DirectiveOrUri properties |
src/Enums/CspCommandType.cs |
Adds XML documentation clarifying when to use Directive vs Uri enum values |
docs/configuration/Content-Security-Policy.md |
Expands documentation with detailed examples and explanations of directive vs URI configuration |
docs/changelog.md |
Updates changelog to document the increased CSP documentation coverage |
changelog.md |
Updates root changelog with same CSP documentation improvements |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
GaProgMan
approved these changes
Aug 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this PR
This PR adds some extra documentation around the Content-Security-Policy header values and how they are used by the header. It is related to bug #185, but does not close it.
As this is a documentation only change, I have increased the patch version number and updated relevant changelogs only.
PR Checklist
Feel free to either check the following items (by place an
xinside of the square brackets) or by replacing the square brackets with a relevant emoji from the following list:Essential
These items are essential and must be completed for each commit. If they are not completed, the PR may not be accepted.
dotnet-formatcommand and fixed any .editorconfig issuesNote
The changelog in the
docs/directory will be updated automatically when PRs are merged into main.Optional
Any Other Information
N/A