Skip to content

Conversation

SergeiPavlov
Copy link
Collaborator

@SergeiPavlov SergeiPavlov commented Mar 6, 2025

This will allow to modify UrlInfo properties by C# with operator.

The .Url & .ToString() will synchronize with the updated property.

The behavior change:

  • UrlInfo.Params is now SortedDictionary
    Without this the order of parameteres in .Url was non-deterministic.
  • UrlInfo parsed from URLs with different order of parameters are considered as Equal now.

@SergeiPavlov SergeiPavlov requested a review from botinko March 6, 2025 21:44
{
[DebuggerStepThrough] get;
set {
field = value;
Copy link

@botinko botinko Mar 8, 2025

Choose a reason for hiding this comment

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

validate port >= 0 and <= 65535

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The URI RFC does not define port limits:
https://www.rfc-editor.org/rfc/rfc3986#section-3.2.3

Yes, for TCP it is 16-bit. But UrlInfo` is considered to be more general

{
[DebuggerStepThrough] get;
set {
field = value;
Copy link

Choose a reason for hiding this comment

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

validate with current regex pattern and parse logic.

{
[DebuggerStepThrough] get => field;
set {
field = value;
Copy link

Choose a reason for hiding this comment

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

validate with current regex pattern and parse logic.

@SergeiPavlov SergeiPavlov changed the title Refactor UrlInfo into record Refactor UrlInfo into immutable record Mar 11, 2025
@SergeiPavlov SergeiPavlov merged commit 0671034 into master-servicetitan Mar 11, 2025
4 checks passed
@SergeiPavlov SergeiPavlov deleted the UrlInfo branch March 11, 2025 21:28
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.

2 participants