Closed Masterzach32 closed 4 years ago
Huh, I've never seen a cookie that had no value at all. Weird. Is that even allowed? Well regardless we can certainly handle it. If you want to open a PR feel free but please include tests.
Huh, as expected, the spec is vague about the idea of a value being null (unsurprising as the various cookie RFCs are all a train wreck), but I did find another thing we don't handle. The value can be double quote-encased.
@Masterzach32 https://github.com/Kong/unirest-java/commit/3c4eb8a78d8dd682209e58e3e3747de7ecbc1ee4
Should have a release soon, there some other cookie parsing issues I want to address first
3.4.01 should be in mvn central in about 20 minutes
Describe the bug When parsing a cookie with no value, an ArrayIndexOutOfBoundsException is thrown for example:
SignOnDefault=; domain=.admin.virginia.edu; path=/; HttpOnly
To Reproduce
Expected behavior Cookie is parsed normally, and has an empty/blank String object as its value
Environmental Data:
Additional context Error is occurring here when parsing cookie. Since the name/value pair of the cookie is split around
=
and no text follows,sub
has only 1 value.I can make a PR that changes it to this, which fixes the issue
Has anyone else encountered this?