Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cookie: Fix bug in export if any-domain cookie is present
In 3013bb6 I had changed cookie export to ignore any-domain cookies, however the logic I used to do so was incorrect, and would lead to a busy loop in the case of exporting a cookie list that contained any-domain cookies. The result of that is worse though, because in that case the other cookies would not be written resulting in an empty file once the application is terminated to stop the busy loop.
- Loading branch information
ef0fdb8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bagder Though I had tested my initial changes in 3013bb6, which is obviously incorrect in hindsight, I didn't catch this. The only thing I can think of as plausible is I had assigned a domain to the Set-Cookie line at some point in my test project and then forgot about that later when I made and tested the export changes, but I just don't remember. As described in the commit message the bug is serious, unfortunately, if one uses CURLOPT_COOKIELIST with Set-Cookie and then tries to export the cookies. Sorry about this.