Malformed Request URL causes 500 response
Next.js router-server fails to handle malformed URL percent-encoding, returning 500 Internal Server Error instead of 400 Bad Request when a catch-all route is present.

Tech tag
Published reports that match this technical term, gathered from the local catalog.
Next.js router-server fails to handle malformed URL percent-encoding, returning 500 Internal Server Error instead of 400 Bad Request when a catch-all route is present.
When using next/image with a relative src that returns a 302 redirect to an external image, the built-in image optimizer does not follow the redirect and returns a 500 Internal Server Error, while a native <img> displays correctly.
Next.js 16.3.x uses httpxy for rewrites with a shared keep-alive agent, which can reuse an idle socket at the same moment the upstream closes it, causing a race condition that intermittently returns 500 on the second socket connection.
Next.js 16.2.0 and later respond with a 500 Internal Server Error when receiving an OPTIONS * request, whereas earlier versions correctly returned 400 Bad Request or another valid response. This regression affects both development and production servers.