requests
requests copied to clipboard
fix: handle empty string cookie values correctly
_find_no_duplicates() was checking if toReturn: which treats empty string as falsy.
This causes KeyError when retrieving a cookie with an empty string value:
jar = RequestsCookieJar()
jar.set("empty", "")
jar["empty"] # KeyError!
Fixed by checking if toReturn is not None: instead.
Added test case.