Skip to content

Conversation

jkporter
Copy link
Contributor

@jkporter jkporter commented Sep 8, 2025

fix: Allow file scheme URLs for Load

Strengthens checks of URI scheme and adjusts behavior to support file scheme. Falls back to pre-existing behavior otherwise

Updated URL prefix checks to include colons for "http:" and "https:". Improved handling of file URLs by adding a check for the "file:" prefix to extract the local path. Adjusted format extraction logic to work with the new file name variable.
@jkporter jkporter requested a review from a team as a code owner September 8, 2025 21:50
@jkporter
Copy link
Contributor Author

jkporter commented Sep 8, 2025

@microsoft-github-policy-service agree

Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

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

Thank you for making the changes!

@baywet baywet enabled auto-merge (squash) September 19, 2025 14:54
Comment on lines +326 to +333
if (url.StartsWith("file:", StringComparison.OrdinalIgnoreCase))
{
fileName = new Uri(url).LocalPath;
}
else
{
fileName = url;
}

Check notice

Code scanning / CodeQL

Missed ternary opportunity Note

Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
@baywet baywet merged commit d93689c into microsoft:main Sep 19, 2025
9 checks passed
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