File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -64,21 +64,14 @@ public void DeleteAllCookies()
6464
6565 public Cookie GetCookieNamed ( string name )
6666 {
67- Cookie cookieToReturn = null ;
68- if ( name != null )
67+ if ( name is null )
6968 {
70- ReadOnlyCollection < Cookie > allCookies = this . AllCookies ;
71- foreach ( Cookie currentCookie in allCookies )
72- {
73- if ( name . Equals ( currentCookie . Name ) )
74- {
75- cookieToReturn = currentCookie ;
76- break ;
77- }
78- }
69+ throw new ArgumentNullException ( "{nameof(name)}" ) ;
7970 }
8071
81- return cookieToReturn ;
72+ var rawCookie = driver . InternalExecute ( $ "{ DriverCommand . GetCookie } /{ name } ", null ) . Value ;
73+
74+ return Cookie . FromDictionary ( rawCookie as Dictionary < string , object > ) ;
8275 }
8376
8477 private ReadOnlyCollection < Cookie > GetAllCookies ( )
You can’t perform that action at this time.
0 commit comments