Skip to content

Query string array parsing behavior changed in version 6.14.1 #537

@francescorivola

Description

@francescorivola

Follow test is passing in version 6.14.0, but it fails in 6.14.1.

import { deepEqual } from "node:assert/strict";
import { describe, it } from "node:test";
import qs from "qs";

describe("qs module", function () {
  it("should parse query strings as an array", function () {
    const values = Array.from({ length: 21 }, (_, index) => "value" + index);
    const queryString = values.map((id) => `id=${id}`).join("&");
    const parsed = qs.parse(queryString);
    deepEqual(parsed.id, values);
  });
});

Likely related to 3086902

After upgrade due to an npm audit report we have observed test failures. Our express application is allowing up to 50 ids in an endpoint query string param. I am not sure if was intended but TBH I think it could be dangerous introducing this behavior change as part of a patch version.

Please, let me know if you need any other information, glad to help.

Thank you very much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions