bug: updateCookies ignores error from page.Context().Cookies() #7
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent: #1
Description
In
playwright.go:138-153,updateCookies()callspage.Context().Cookies(page.URL())and assigns bothcookiesanderr, buterris not checked before iteratingcookies:If
Cookies()returns an error, it's silently swallowed and the cookie jar won't be updated.Fix
Add
if err != nil { return fmt.Errorf("error getting cookies: %w", err) }after theCookies()call.Starting work on this as part of PR 6 (also includes #18). Will add error check for
page.Context().Cookies()inplaywright.go:140.Work finished. PR: #37 (merged)
Added error check for
page.Context().Cookies()before iterating.