Skip to content

Commit aec3b87

Browse files
authored
Merge pull request #11 from go-auxiliaries/fix_add_cookie
Fix add cookie issue
2 parents 3aa67c2 + 07dd60a commit aec3b87

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

remote.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"errors"
1212
"fmt"
1313
"io/ioutil"
14+
"math"
1415
"mime"
1516
"net/http"
1617
"net/url"
@@ -1027,6 +1028,9 @@ func (wd *remoteWD) GetCookies() ([]Cookie, error) {
10271028
}
10281029

10291030
func (wd *remoteWD) AddCookie(cookie *Cookie) error {
1031+
if cookie.Expiry == 0 {
1032+
cookie.Expiry = math.MaxUint32
1033+
}
10301034
return wd.voidCommand("/session/%s/cookie", map[string]*Cookie{
10311035
"cookie": cookie,
10321036
})

0 commit comments

Comments
 (0)