-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: URLEncodedFormDecoder ignores empty value when decoding Array #2584
Conversation
}) | ||
self.values = try values.flatMap { value in | ||
try value.asUrlEncoded().split(omittingEmptySubsequences: false) { | ||
configuration.arraySeparators.contains($0) |
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.
LGTM, but I've got I feel like we should change this to:
split(omittingEmptySubsequences: false, whereSeparator: configuration.arraySeparators.contains)
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.
LGTM
These changes are now available in 4.41.10 |
When
URLEncodedFormDecoder
decodesarray[]=a&array[]=&array[]=b&array[]=
, empty values are ignored and we get incorrect result["a", "b"]
.After this change the result will be
["a", "", "b", ""]
.