fryette / webview_cookie_manager

MIT License
48 stars 52 forks source link

Ignore cookies with invalid values #49

Closed dtyoung closed 3 years ago

dtyoung commented 3 years ago

When calling getCookies(), all cookies for the provided url are serialised. There is a possibility that a cookie's value could contain invalid characters. If this is the case, a FormatException is thrown during the creation of the Cookie object, resulting in no cookies being serialised. This is particularly annoying if the desired result of calling getCookies() is to fetch information about a particular cookie.

This commit handles serialisation of cookies with invalid values by catching any cookies with invalid values and removing them from the returned list of cookies.

Aulig commented 3 years ago

This is useful, looking forward to seeing this merged so I can remove my empty try catch that catches these formatexceptions.

fryette commented 3 years ago

I will take a look at it at weekend and provide a new version. Thanks for your contribution.

dtyoung commented 3 years ago

Hi @fryette. Have you had the time to take a look at this yet?