You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(query): array with empty string elements serializes with trailing equals unlike scalar empty string #394
In encodeQueryItem(), when a scalar empty string "" is passed, it returns encodeQueryKey(key) without an = sign:
encodeQueryItem("flag","")// Returns: "flag"
However, when an array containing an empty string element [""] is passed, the array mapping unconditionally formats as ${encodeQueryKey(key)}=${encodeQueryValue(_value)}, producing an = sign:
I reproduced the difference on current main and added regression tests for scalar/array empty strings, mixed values and encoded keys. I'm preparing a minimal fix for empty string array elements to use the same bare-key encoding as scalar empty strings; null/undefined array behavior stays unchanged. I checked #391: its performance change touches the same branch but retains the behavior reported here, so this fix may need rebasing if it merges first.
Thanks for verifying and putting together the fix @owenshen0907! Good catch on keeping the null/undefined array behavior intact and watching out for the overlap with #391. Looking forward to the PR!
Activity
owenshen0907 commentedon Oct 11, 2026
I reproduced the difference on current main and added regression tests for scalar/array empty strings, mixed values and encoded keys. I'm preparing a minimal fix for empty string array elements to use the same bare-key encoding as scalar empty strings; null/undefined array behavior stays unchanged. I checked #391: its performance change touches the same branch but retains the behavior reported here, so this fix may need rebasing if it merges first.
abhi-byte62 commentedon Oct 11, 2026
Thanks for verifying and putting together the fix @owenshen0907! Good catch on keeping the null/undefined array behavior intact and watching out for the overlap with #391. Looking forward to the PR!