Debugging a 400 Error Caused by Double-Encoded URL Query Values
A 400 error that appears only when query values contain spaces or special characters is often caused by double percent-encoding. The client encodes a value once and then a helper or proxy encodes it again, so a space becomes %2520 rather than %20. The server decodes only once and receives the literal text %20, which fails validation or matches nothing. The bug is easy to miss because simple values like "report" pass through unchanged. The recommended fix is to encode exactly once at the boundary that builds the URL and pass raw values through every layer above it, with tests asserting the exact wire format.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in