diff --git a/identity-server/src/IdentityServer/Extensions/StringsExtensions.cs b/identity-server/src/IdentityServer/Extensions/StringsExtensions.cs index 268d16869..c86503186 100644 --- a/identity-server/src/IdentityServer/Extensions/StringsExtensions.cs +++ b/identity-server/src/IdentityServer/Extensions/StringsExtensions.cs @@ -207,16 +207,9 @@ public static bool IsUri(this string input) return false; } - if (uri.IsFile) - { - // no need to check if input starts with {Uri.UriSchemeFile}:// because uri.IsFile ensures it is either '/' or `file://` - if (!input.StartsWith(Uri.UriSchemeFile, StringComparison.OrdinalIgnoreCase)) - { - return false; - } - } - - return true; + return !uri.IsFile || + // no need to check if input starts with {Uri.UriSchemeFile}:// because uri.IsFile ensures it is either '/' or `file://` + input.StartsWith(Uri.UriSchemeFile, StringComparison.OrdinalIgnoreCase); } [DebuggerStepThrough]