SShortSingh.
Back to feed

Debugging a 400 Error Caused by Double-Encoded URL Query Values

0
·5 views

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.

Read the full story at DEV Community

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

Related stories

0
ProgrammingHacker News ·

Wasmer, a YC S19 Company, Recruits OS and Hypervisor Engineers in Europe

Wasmer, a startup from Y Combinator's S19 batch, is seeking operating system and hypervisor specialists for roles based in Europe. The job listing is posted on Work at a Startup, the platform Y Combinator uses for its portfolio companies. The announcement appeared on Hacker News with no points or comments at the time it was captured. The source material provides few further details about the specific responsibilities, seniority levels, or compensation for these positions.

0
ProgrammingDEV Community ·

Testing Outbound Webhooks with Signed Payloads and Retry Logic

Outbound webhook testing is tricky because the system under test is the caller, so it needs a receiver that verifies signatures and mimics real endpoint failures. Public request-bin endpoints only confirm that a request was sent, not that its HMAC is correct or that a tampered body would be rejected. A local mock receiver can instead recompute the signature over the raw request bytes, making signing errors fail tests reliably. Such a mock can also be configured to return a 500 on the first attempt, letting tests confirm that the producer retries and reuses the same event ID. Generating the mock from an OpenAPI spec adds schema validation, catching undocumented fields or wrong types in delivered payloads.

0
ProgrammingDEV Community ·

Agent Ping: a menu bar panel that shows which of six coding agents is waiting on you

A developer running six coding agents at once found that the hard part was not throughput but telling which sessions were stalled, since windows and desktop notifications fail to show when a tool is asking a question or has died on an error. To fix this, they built Agent Ping, a menu bar panel that reads each tool's local session logs and sorts sessions into five states, with the "waiting on you" group first and the verbatim question shown. Clicking a row returns the user to that session, though it deliberately does not orchestrate agents and makes no network calls. The first release has known gaps: ZCode lacks session-level links, Linux support was only checked in a container, and other tools with unparsed log formats are not covered. It is distributed via Homebrew and compiles from source on macOS 13+ or as an X11 tray item on Linux.