Fix reporting endpoint URL validation on .NET 10 Linux#2
Draft
MPCoreDeveloper with Copilot wants to merge 3 commits into
Draft
Fix reporting endpoint URL validation on .NET 10 Linux#2MPCoreDeveloper with Copilot wants to merge 3 commits into
MPCoreDeveloper with Copilot wants to merge 3 commits into
Conversation
…10 Linux Uri.TryCreate behavior
On .NET 10 Linux, Uri.TryCreate("/reports", UriKind.Absolute, out _) returns true
because it interprets the path as file:///reports. The validator now additionally
checks that the parsed URI has an http or https scheme, ensuring relative paths
and non-web URIs are properly rejected.
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job Build, test, and pack
Fix reporting endpoint URL validation on .NET 10 Linux
Jul 25, 2026
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.
Description
On .NET 10 Linux,
Uri.TryCreate("/reports", UriKind.Absolute, out _)returnstruebecause the runtime interprets Unix-style paths asfile://URIs. The validator only checked for "absolute" URIs, so relative paths like/reportssilently passed validation andOptionsValidationExceptionwas never thrown.Fix: After
Uri.TryCreatesucceeds, also assert the scheme ishttporhttps:Changed file:
src/SafeWebCore/Infrastructure/NetSecureHeadersOptionsValidator.csRelated Issue
Type of Change
Checklist
dotnet test)