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

[spam] #521

Closed
Keboletsetse opened this issue Jan 6, 2025 · 0 comments
Closed

[spam] #521

Keboletsetse opened this issue Jan 6, 2025 · 0 comments

Comments

@Keboletsetse
Copy link

          one simple solution would be to include the prefix here as well

qs/lib/stringify.js

Lines 123 to 129 in 981ce09

if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
if (encoder) {
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
}
return [formatter(prefix) + '=' + formatter(String(obj))];
}

to this:

    if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
        if (encoder) {
            var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key',  format, undefined);
            return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format, prefix))];
        }
        return [formatter(prefix) + '=' + formatter(String(obj))];
    }

without introducing any breaking changes to the library

Originally posted by @vanenshi in #491 (comment)

@ljharb ljharb changed the title one simple solution would be to include the prefix here as well [spam] Jan 6, 2025
@ljharb ljharb closed this as not planned Won't fix, can't repro, duplicate, stale Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants