Skip to content

Commit ad6632e

Browse files
author
Qi Xiao
committed
Fix cookie count error
1 parent 093d5fc commit ad6632e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

parser/parser.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ func (t *Task) parseResponse(rc *recordCollector) (cookieCount int, resultData [
236236
})
237237
}
238238

239+
cookieCount = len(cookieSeqMap)
240+
239241
// load all cookies from browser api
240242
allCookies, err := t.remote.GetAllCookies()
241243
if err != nil {
@@ -245,6 +247,8 @@ func (t *Task) parseResponse(rc *recordCollector) (cookieCount int, resultData [
245247

246248
for _, cookie := range allCookies {
247249
if _, ok := cookieSeqMap[cookie.Name]; !ok {
250+
cookieCount++
251+
248252
// cookie plant by scripts
249253
var (
250254
category = ""
@@ -283,7 +287,6 @@ func (t *Task) parseResponse(rc *recordCollector) (cookieCount int, resultData [
283287
}
284288
}
285289

286-
cookieCount = len(cookieSeqMap)
287290
hasUnclassified := false
288291

289292
// sort unclassified cookies to the end

0 commit comments

Comments
 (0)