Skip to content

AWS API Gateway returns 400 when {} are present in query values #1114

@aldenquimby

Description

@aldenquimby

Context

What's your version of nuqs?

    "nuqs": "2.5.2",

What framework are you using?

  • ✅ Next.js (app router)

Which version of your framework are you using?

    "next": "14.2.32",

Description

  • Requests to AWS API Gateway with {} in query values fail with 400 bad request (and appear to hard-crash the gateway, because no execution or access logs appear in CloudWatch for these requests)
  • I am trying to use parseAsJson, which ends up serializing { hello: ['a', 'b'] } as {%22hello%22:[%22a%22,%22b%22]}
  • I expect {} to be URL-escaped into %7B and %7D respectively
  • :, [, and ] do not need to be escaped - AWS API Gateway works fine with those as-is

Reproduction

  • I do not have any public API Gateway services right now
  • I could look into creating one if needed

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions