Skip to content
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

[update] stringify with comma:true to decode comma for an array as a reserved char per RFC3986 #338

Open
wants to merge 1 commit into
base: master
from

Conversation

@Om4ar
Copy link
Contributor

Om4ar commented Oct 18, 2019

pr to correctly stringify a array with formatArray as a comma

keeping the comma character decoded to separate items for this character a reserved one per RFC3986

fixes: #337

… for an array as a reserved char
@ljharb ljharb added the stringify label Oct 23, 2019
@ljharb

This comment has been minimized.

Copy link
Owner

ljharb commented Oct 23, 2019

When the format is "RFC3986", this seems correct. However (see https://github.com/ljharb/qs#rfc-3986-and-rfc-1738-space-encoding) when the format is RFC1738, for example, i would not expect it to be encoded.

@Om4ar

This comment has been minimized.

Copy link
Contributor Author

Om4ar commented Oct 23, 2019

will try to do it for RFC3986 only

@ljharb ljharb force-pushed the Om4ar:stringify-comma branch from 4c4f45b to 8da95de Nov 8, 2019
Copy link
Owner

ljharb left a comment

I've rebased this and tweaked some things, but an easy solution hasn't yet presented itself.

} else {
if (encoder) {
var commaKey = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key');
var commaValue = obj.map(function (item) {

This comment has been minimized.

Copy link
@ljharb

ljharb Nov 8, 2019

Owner

we can't add a dependency on .map here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.