Skip to content

Conversation

@jnyrup
Copy link
Contributor

@jnyrup jnyrup commented Aug 8, 2025

Description

Using grep.app I noticed that a slightly incorrect regex was introduced in #10340 to match "host and port".

[:|,] matches any of the characters :, '|' or ,, where the updated regex [:,] only matches : or ,.

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 8, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Aug 8, 2025
@davidfowl davidfowl requested a review from Copilot August 8, 2025 11:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a regex pattern in the ConnectionStringParser that was incorrectly matching pipe characters ('|') as valid port separators. The change ensures only colon (':') and comma (',') are recognized as valid separators between host and port in connection strings.

Key Changes

  • Updated the regex pattern to remove pipe character from the character class
  • Changed [:|,] to [:,] to match only colon or comma separators

@davidfowl
Copy link
Member

Good catch

@davidfowl davidfowl merged commit 2383d5b into dotnet:main Aug 8, 2025
282 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 9.5 milestone Aug 8, 2025
@jnyrup jnyrup deleted the port_regex branch August 8, 2025 13:33
@github-actions github-actions bot locked and limited conversation to collaborators Sep 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

community-contribution Indicates that the PR has been added by a community member needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants