Skip to content

Conversation

@JoshLozensky
Copy link
Contributor

@JoshLozensky JoshLozensky commented Feb 25, 2025

This pull request changes logic in the ParseAuthorityIfNecessary method in the MergedOptions class to fix a bug where the check on the indexTenant always evaluates to true.

Originally, there had been a bug here because the '/' chars in the scheme prefix of the URI were not taken into account leading to false positives when checking for the presence of the instance/tenantId

This PR went into Id Web in 3.1.0 and attempted to address the above bug but accidentally created another where the indexTenant >=0 condition always evaluated to true as its min possible value was 7.

The current PR fixes this by making the starting index of the authority URI scheme-agnostic and uses that dynamic value to compare against the indexTenant variable.

@JoshLozensky JoshLozensky requested a review from a team as a code owner February 25, 2025 22:58
@github-actions

This comment was marked as resolved.

Copy link
Collaborator

@jmprieur jmprieur left a comment

Choose a reason for hiding this comment

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

Thanks @JoshLozensky
We probably need to add a unit test that would fail before the bug was fixed?

@JoshLozensky JoshLozensky marked this pull request as draft February 25, 2025 23:17
@github-actions

This comment was marked as resolved.

@JoshLozensky
Copy link
Contributor Author

Thanks @JoshLozensky We probably need to add a unit test that would fail before the bug was fixed?

Added :)

@JoshLozensky JoshLozensky marked this pull request as ready for review February 27, 2025 02:38
@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@JoshLozensky JoshLozensky force-pushed the lozensky/AuthorityHttpsCheck branch from ead93b8 to 2dce84c Compare March 5, 2025 19:57
This was referenced Nov 6, 2025
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.

Incorrect authority parsing in MergedOptions.ParseAuthorityIfNecessary

8 participants