sitespeedio / chrome-har

Create HAR files from Chrome Debugging Protocol data
MIT License
148 stars 50 forks source link

Fix: Optional cookie object #73

Closed mikedijkstra closed 4 years ago

mikedijkstra commented 4 years ago

This PR fixes a bug where an error is thrown when the cookie object is missing from the blocked cookies array of a Network.responseReceivedExtraInfo event.

I missed this in my initial testing, but the cookie object is optional and might not be present, as per the Network.responseReceivedExtraInfo specification.

To fix this bug, this PR will check for the presence of the cookie object and if it exists use that, if not it will parse the cookieLine and use that. This PR also updates the test fixture to include a blocked cookie that is missing a cookie object.

soulgalore commented 4 years ago

Thank you @mikedijkstra for the fix!