Bugfix/coep default header value#173
Merged
GaProgMan merged 17 commits intoJan 7, 2026
Merged
Conversation
GaProgMan
requested changes
Aug 4, 2025
GaProgMan
previously approved these changes
Aug 4, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements support for the experimental Reporting-Endpoints HTTP header, which allows website administrators to specify endpoints for receiving reports from the browser's Reporting API. The header is intended to work with Content Security Policy (CSP) and other security policies that can generate violation reports.
- Adds
ReportingEndpointsPolicymodel with configuration and header value generation - Implements middleware support for the new header with
UseReportingEndpointsPolicyextension method - Updates CSP configuration to support the modern
report-todirective alongside the deprecatedreport-uri
Reviewed Changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/Models/ReportingEndpointsPolicy.cs |
New model class for configuring Reporting-Endpoints header with endpoint name-to-URI mappings |
src/Extensions/SecureHeadersMiddlewareBuilder.cs |
Adds builder method for configuring Reporting-Endpoints policy and updates CSP methods |
src/Models/ContentSecurityPolicyConfiguration.cs |
Adds support for report-to directive and marks report-uri as obsolete |
src/Extensions/StringBuilderExtensions.cs |
New utility method for removing trailing characters from StringBuilder |
tests/OwaspHeaders.Core.Tests/CustomHeaders/ReportingEndpointsTests.cs |
Test coverage for the new Reporting-Endpoints functionality |
docs/configuration/ReportingEndpoints.md |
Documentation for the experimental header with appropriate warnings |
Owner
|
As PR #189 will likely be merged ahead of this one, we'll need a version bump on this PR. |
Collaborator
Author
|
Deleted the wrong branch when trying to clean up. Sorry all. |
# Conflicts: # changelog.md # src/Constants.cs # src/OwaspHeaders.Core.csproj
a2ed26f to
fec46d6
Compare
# Conflicts: # docs/changelog.md
Owner
|
Assuming the CI steps complete successfully, LGTM. |
1 similar comment
Owner
|
Assuming the CI steps complete successfully, LGTM. |
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 the Reporting-Endpoints header, configuration for it, updates the relevant documentation, and increases the version number.
This PR closes #170
The following is a minimal code sample for the new feature:
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 issuesOptional
Any Other Information
This PR adds experimental functionality. Depending on feedback, it might not be closed.