Skip to content

Reject trailing newlines in package IDs - #7875

Merged
zivkan merged 1 commit into
devfrom
dev-zivkan-package-id-validation
Nov 11, 2026
Merged

zivkan merged 1 commit into
devfrom
dev-zivkan-package-id-validation

Conversation

@zivkan

@zivkan zivkan commented Nov 10, 2026

Copy link
Copy Markdown
Member

Bug

Fixes: NuGet/Home#15139

Description

Reject package IDs ending in a newline by replacing the regex $ anchor with \z. Unlike $, which also matches before a final newline, \z requires the actual end of the string.

Add regression coverage for whitespace in package IDs and trailing-newline rejection through Protocol validation.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc. N/A

@zivkan
zivkan marked this pull request as ready for review November 10, 2026 20:47
@zivkan
zivkan requested a review from a team as a code owner November 10, 2026 20:47
@zivkan
zivkan requested review from jebriede and nkolev92 November 10, 2026 20:47

@Francky5135 Francky5135 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All is done.

@zivkan
zivkan merged commit 7e935f9 into dev Nov 11, 2026
17 of 18 checks passed
@zivkan
zivkan deleted the dev-zivkan-package-id-validation branch November 11, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PackageIdValidator should not accept trailing new line

4 participants