Skip to content

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Oct 31, 2024

Description

URL detection regex was including trailing content in the URL after semi-colon. In some connection strings this would pick up extra values, e.g. content after the URL would be included in Endpoint=http://myaccount.example.com/;key=abc.

The new URL is based on GitHub's URL detection for source code. It excludes content after ; from the URL. This is the same behavior as VS. Technically ; can be part of a URL, but more commonly it is used as a delimiter for connection strings and collections of URLs.

There isn't a perfect answer here, but the new regex match seems the better alternative. We should be conservative when assuming what content should be in the URL rather than aggressively including too much.

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 TBD
    • No
  • Does the change require an update in our Aspire docs?
Microsoft Reviewers: Open in CodeFlow

@JamesNK JamesNK changed the title Add url with semicolon Change URL detection regex to exclude trailing content Oct 31, 2024
@JamesNK JamesNK requested review from drewnoakes and adamint October 31, 2024 13:59
@JamesNK JamesNK marked this pull request as ready for review October 31, 2024 14:02
Copy link
Member

@mitchdenny mitchdenny left a comment

Choose a reason for hiding this comment

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

LGTM

@JamesNK JamesNK merged commit 0836cf6 into main Nov 3, 2024
9 checks passed
@JamesNK JamesNK deleted the jamesnk/stress-url-semicolon branch November 3, 2024 13:39
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants