Skip to content

Commit 785e8d9

Browse files
committed
Don't allow invalid incoming cookie name
1 parent d0e3003 commit 785e8d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dotnet/src/webdriver/CookieJar.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ public void DeleteAllCookies()
117117
/// <returns>A Cookie from the name; or <see langword="null"/> if not found.</returns>
118118
public Cookie? GetCookieNamed(string name)
119119
{
120-
if (name is null)
120+
if (string.IsNullOrWhiteSpace(name))
121121
{
122-
throw new ArgumentNullException(nameof(name));
122+
throw new ArgumentException("Cookie name cannot be empty", nameof(name));
123123
}
124124

125125
try

0 commit comments

Comments
 (0)