Skip to content

fix: Check if cookies are iterable before iterating#356

Open
das-peter wants to merge 1 commit into
minkphp:masterfrom
das-peter:patch-1
Open

fix: Check if cookies are iterable before iterating#356
das-peter wants to merge 1 commit into
minkphp:masterfrom
das-peter:patch-1

Conversation

@das-peter

Copy link
Copy Markdown

It can happen that the returned value is not iterable. The geetAllCookies() methode also declares the its return as "mixed".
Just about having slightly more defensive code.

It can happen that the returned value is not iterable. The geetAllCookies() methode also declares the its return as "mixed".
@codecov

codecov Bot commented Apr 28, 2022

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.04%. Comparing base (e5f8421) to head (f387514).
⚠️ Report is 61 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #356      +/-   ##
============================================
+ Coverage     90.02%   90.04%   +0.02%     
- Complexity      150      151       +1     
============================================
  Files             1        1              
  Lines           421      422       +1     
============================================
+ Hits            379      380       +1     
  Misses           42       42              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stof

stof commented Apr 28, 2022

Copy link
Copy Markdown
Member

In which case does this happen ?

@das-peter

Copy link
Copy Markdown
Author

I had a request to wd/hub/session/chrome-100-0-4896-75-1-bc5dc535-0653-4f64-814c-d172db4c1582/session/bed6779a89bb52104cef11e83d40d7e6/cookie return null as value.
Underlying library is instaclick/php-webdriver - \WebDriver\Session::getAllCookies() which just passes the value as received from the endpoint back to the consumer.
It is highly likely this is / was an error on the endpoint but I don't think this warrants a generic failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants