Skip to content

Commit

Permalink
Remove unused flag in Uri (#98076)
Browse files Browse the repository at this point in the history
  • Loading branch information
MihaZupan authored Feb 8, 2024
1 parent 36f0d8c commit 039cd77
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
5 changes: 1 addition & 4 deletions src/libraries/System.Private.Uri/src/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@
<data name="net_uri_BadScheme" xml:space="preserve">
<value>Invalid URI: The URI scheme is not valid.</value>
</data>
<data name="net_uri_BadString" xml:space="preserve">
<value>Invalid URI: There is an invalid sequence in the string.</value>
</data>
<data name="net_uri_BadUserPassword" xml:space="preserve">
<value>Invalid URI: The username:password construct is badly formed.</value>
</data>
Expand Down Expand Up @@ -201,4 +198,4 @@
<data name="net_uri_GetComponentsCalledWhenCanonicalizationDisabled" xml:space="preserve">
<value>GetComponents() may not be used for Path/Query on a Uri instance created with UriCreationOptions.DangerousDisablePathAndQueryCanonicalization.</value>
</data>
</root>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,5 @@ internal enum UnescapeMode
EscapeUnescape = Unescape | Escape, // does both escaping control+reserved and unescaping of safe characters
V1ToStringFlag = 0x4, // Only used as V1.0 ToString() compatibility mode, assumes DontEscape level also
UnescapeAll = 0x8, // just unescape everything, leave bad escaped sequences as is
UnescapeAllOrThrow = 0x10 | UnescapeAll, // just unescape everything plus throw on bad escaped sequences
}
}
10 changes: 0 additions & 10 deletions src/libraries/System.Private.Uri/src/System/UriHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,6 @@ internal static unsafe void UnescapeString(char* pStr, int start, int end, ref V
{
if (ch == Uri.c_DummyChar)
{
if (unescapeMode >= UnescapeMode.UnescapeAllOrThrow)
{
// Should be a rare case where the app tries to feed an invalid escaped sequence
throw new UriFormatException(SR.net_uri_BadString);
}
continue;
}
}
Expand Down Expand Up @@ -369,11 +364,6 @@ internal static unsafe void UnescapeString(char* pStr, int start, int end, ref V
}
else if (unescapeMode >= UnescapeMode.UnescapeAll)
{
if (unescapeMode >= UnescapeMode.UnescapeAllOrThrow)
{
// Should be a rare case where the app tries to feed an invalid escaped sequence
throw new UriFormatException(SR.net_uri_BadString);
}
// keep a '%' as part of a bogus sequence
continue;
}
Expand Down

0 comments on commit 039cd77

Please sign in to comment.